Skip to content

Commit

Permalink
Misc: Add translation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Leleat committed May 1, 2024
1 parent 4e63cbd commit b16474b
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 142 deletions.
6 changes: 5 additions & 1 deletion scripts/update-tl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ echo -n Updating \'translations/main.pot\'
xgettext \
--from-code=UTF-8 \
--output=translations/main.pot \
./*/*/*/*.ui ./*/*.js ./*/*/*.js ./*/*/*/*.js
--add-comments='Translators:' \
./tiling-assistant@leleat-on-github/*/*/*.ui \
./tiling-assistant@leleat-on-github/*.js \
./tiling-assistant@leleat-on-github/*/*.js \
./tiling-assistant@leleat-on-github/*/*/*.js
echo \ ......... done.

# update .po files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export default class TilingKeybindingHandler {
const toggleTo = !Settings.getBoolean('enable-tiling-popup');
Settings.setBoolean('enable-tiling-popup', toggleTo);
Main.notify('Tiling Assistant', toggleTo
// Translators: This is the notification text when the Tiling Popup is enabled/disabled via the keyboard shortcut
? _('Tiling popup enabled')
// Translators: This is the notification text when the Tiling Popup is enabled/disabled via the keyboard shortcut
: _('Tiling popup was disabled'));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default class TilingLayoutsManager {
openPopupSearch() {
const layouts = Util.getLayouts();
if (!layouts.length) {
// Translators: This is a notification that pops up when a keyboard shortcut to activate a user-defined tiling layout is activated but no layout was defined by the user.
Main.notify('Tiling Assistant', _('No valid layouts defined.'));
return;
}
Expand Down Expand Up @@ -192,6 +193,7 @@ export default class TilingLayoutsManager {
_openAppTiled(appId) {
const app = Shell.AppSystem.get_default().lookup_app(appId);
if (!app) {
// Translators: This is a notification that pops up when a keyboard shortcut to activate a user-defined tiling layout is activated and the user attached an app to a tile so that a new instance of that app will automatically open in the tile. But that app seems to have been uninstalled since the definition of the layout.
Main.notify('Tiling Assistant', _('Popup Layouts: App not found.'));
this._finishLayouting();
return;
Expand Down Expand Up @@ -334,7 +336,7 @@ const LayoutSearch = GObject.registerClass({
style: `font-size: ${fontSize}px;\
border-radius: 16px;
margin-bottom: 12px;`,
// The cursor overlaps the text, so add some spaces at the beginning
// Translators: This is the placeholder text for a search field.
hint_text: ` ${_('Type to search...')}`
});
const entryClutterText = entry.get_clutter_text();
Expand Down Expand Up @@ -439,8 +441,7 @@ const SearchItem = GObject.registerClass(
class TilingLayoutsSearchItem extends St.Label {
_init(text, fontSize) {
super._init({
// Add some spaces to the beginning to align it better
// with the rounded corners
// Translators: This is the text that will be displayed as the name of the user-defined tiling layout if it hasn't been given a name.
text: ` ${text || _('Nameless layout...')}`,
style: `font-size: ${fontSize}px;\
text-align: left;\
Expand Down Expand Up @@ -491,6 +492,7 @@ const PanelIndicator = GObject.registerClass({

const layouts = Util.getLayouts();
if (!layouts.length) {
// Translators: This is a placeholder text within a popup, if the user didn't define a tiling layout.
const item = new PopupMenu.PopupMenuItem(_('No valid layouts defined.'));
item.setSensitive(false);
this.menu.addMenuItem(item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class TileEditingMode extends St.Widget {

const openWindows = Twm.getWindows();
if (!openWindows.length || !this._windows.length) {
// Translators: This is a notifcation that pops up if the user tries to enter the Tile Editing Mode via a keyboard shortcut.
const msg = _("Can't enter 'Tile Editing Mode', if no tiled window is visible.");
Main.notify('Tiling Assistant', msg);
this.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const LayoutRowEntry = GObject.registerClass({
// Show a placeholder on the first entry, if it's empty
if (!text) {
if (idx === 0) {
// Translators: This is a placeholder text of an entry in the prefs when defining a tiling layout.
const placeholder = _("'User Guide' for help...");
this._rectEntry.set_placeholder_text(placeholder);
} else {
Expand Down
Loading

0 comments on commit b16474b

Please sign in to comment.