mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-03 16:41:26 +01:00
feat(core,gui): gettext translations and language preference
The app, the tray and the search prompt route every user-visible string through GNU gettext in the `pdfs` text domain, with named placeholders and plural forms. po/ holds the template, update and build scripts, and catalogs for de, en_GB, es, fr, it, nl, pl and pt_BR. Preferences gains a Language row that overrides the system language from the next start (config `language`). Packages compile the catalogs into /usr/share/locale and the desktop files carry translated descriptions and keywords. docs/TRANSLATING.md describes the workflow.
This commit is contained in:
1 parent
66ab1f5b16
commit
d9064ef880
52 files changed
+45287
-1569
No files matched your search
@@ -0,0 +1,8 @@
|
||||
de
|
||||
en_GB
|
||||
es
|
||||
fr
|
||||
it
|
||||
nl
|
||||
pl
|
||||
pt_BR
|
||||
@@ -0,0 +1,27 @@
|
||||
crates/pdfs-gui/src/activation.rs
|
||||
crates/pdfs-gui/src/app/main.rs
|
||||
crates/pdfs-gui/src/app/pages/activity.rs
|
||||
crates/pdfs-gui/src/app/pages/albums.rs
|
||||
crates/pdfs-gui/src/app/pages/browser.rs
|
||||
crates/pdfs-gui/src/app/pages/devices.rs
|
||||
crates/pdfs-gui/src/app/pages/locations.rs
|
||||
crates/pdfs-gui/src/app/pages/login.rs
|
||||
crates/pdfs-gui/src/app/pages/photo_viewer.rs
|
||||
crates/pdfs-gui/src/app/pages/photos.rs
|
||||
crates/pdfs-gui/src/app/pages/shared.rs
|
||||
crates/pdfs-gui/src/app/pages/shared_by_me.rs
|
||||
crates/pdfs-gui/src/app/pages/status.rs
|
||||
crates/pdfs-gui/src/app/pages/takeout.rs
|
||||
crates/pdfs-gui/src/app/pages/trash.rs
|
||||
crates/pdfs-gui/src/app/pages/verify.rs
|
||||
crates/pdfs-gui/src/app/widgets/details.rs
|
||||
crates/pdfs-gui/src/app/widgets/menu.rs
|
||||
crates/pdfs-gui/src/app/widgets/share_dialog.rs
|
||||
crates/pdfs-gui/src/app/widgets/thumbnails.rs
|
||||
crates/pdfs-gui/src/app/widgets/versions_dialog.rs
|
||||
crates/pdfs-gui/src/dmenu.rs
|
||||
crates/pdfs-gui/src/fzf.rs
|
||||
crates/pdfs-gui/src/i18n.rs
|
||||
crates/pdfs-gui/src/main.rs
|
||||
crates/pdfs-gui/src/prompt.rs
|
||||
crates/pdfs-gui/src/query.rs
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
# Compile every catalog in po/LINGUAS into <localedir>/<lang>/LC_MESSAGES/pdfs.mo.
|
||||
# Packages pass their install tree, e.g. "$pkgdir/usr/share/locale"; for a run
|
||||
# from the source tree use target/locale with PDFS_LOCALEDIR=target/locale.
|
||||
set -euo pipefail
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "usage: $0 <localedir>" >&2
|
||||
exit 2
|
||||
fi
|
||||
localedir="$1"
|
||||
po_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
while read -r lang; do
|
||||
[ -n "$lang" ] || continue
|
||||
mkdir -p "$localedir/$lang/LC_MESSAGES"
|
||||
msgfmt --check --output-file="$localedir/$lang/LC_MESSAGES/pdfs.mo" "$po_dir/$lang.po"
|
||||
done < "$po_dir/LINGUAS"
|
||||
+4626
File diff suppressed because it is too large.
Load diff
+4537
File diff suppressed because it is too large.
Load diff
+4674
File diff suppressed because it is too large.
Load diff
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
# Regenerate po/pdfs.pot from the sources listed in po/POTFILES.in, then merge
|
||||
# the new template into every catalog in po/LINGUAS. Run from anywhere.
|
||||
set -euo pipefail
|
||||
|
||||
po_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$po_dir/.."
|
||||
|
||||
version="$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)"
|
||||
|
||||
xgettext \
|
||||
--language=Rust \
|
||||
--from-code=UTF-8 \
|
||||
--files-from=po/POTFILES.in \
|
||||
--output=po/pdfs.pot \
|
||||
--package-name=proton-drive-linux \
|
||||
--package-version="$version" \
|
||||
--msgid-bugs-address=https://github.com/narrrl/proton-drive-linux/issues \
|
||||
--add-comments=Translators: \
|
||||
--sort-by-file \
|
||||
--keyword= \
|
||||
--keyword=gettext \
|
||||
--keyword=gettext_f \
|
||||
--keyword=gettext_noop \
|
||||
--keyword=pgettext:1c,2 \
|
||||
--keyword=ngettext:1,2 \
|
||||
--keyword=ngettext_f:1,2
|
||||
|
||||
while read -r lang; do
|
||||
[ -n "$lang" ] || continue
|
||||
if [ -f "po/$lang.po" ]; then
|
||||
msgmerge --quiet --update --backup=none --previous "po/$lang.po" po/pdfs.pot
|
||||
else
|
||||
msginit --no-translator --locale="$lang.UTF-8" --input=po/pdfs.pot --output-file="po/$lang.po"
|
||||
fi
|
||||
done < po/LINGUAS
|
||||
Reference in new issue
Block a user