gnome-shell/lint/eslintrc-shell.yml
Florian Müllner 1deb13e1aa extensionUtils: Add gettext convenience helpers
We have initTranslations() for binding an extension's
gettext domain, but nothing to help with using gettext
from an extension.

Such help would be useful though, as an extension that
calls textdomain() like a normal application would
inadvertently changes the default domain for the whole
gnome-shell process.

Instead, extensions have to use domain-specific versions
of the gettext functions:

```js
const Gettext = imports.gettext.domain('my-extension');
const _ = Gettext.gettext;
```

Make this a bit easier by adding those functions directly
to the extensions object when initTranslations() is called,
then expose helper functions for calling them.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2594

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1941>
2021-08-14 18:45:25 +00:00

33 lines
625 B
YAML

rules:
camelcase:
- error
- properties: never
allow: [^vfunc_, ^on_]
consistent-return: error
key-spacing:
- error
- mode: minimum
beforeColon: false
afterColon: true
object-curly-spacing:
- error
- always
prefer-arrow-callback: error
overrides:
- files: js/**
excludedFiles:
- js/portalHelper/*
- js/misc/extensionUtils.js
globals:
global: readonly
_: readonly
C_: readonly
N_: readonly
ngettext: readonly
- files: subprojects/extensions-app/js/**
globals:
_: readonly
C_: readonly
N_: readonly