Skip to content

Commit 8ecdded

Browse files
committed
feat(i18n): add Brazilian Portuguese translation file for Aetheris
1 parent cd5b841 commit 8ecdded

29 files changed

Lines changed: 4183 additions & 510 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
run: |
1818
dnf install -y \
1919
git \
20+
gettext \
2021
gtk4-devel \
2122
gtksourceview5-devel \
2223
libadwaita-devel \

.github/workflows/release-appimage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
findutils \
2929
gcc \
3030
gcc-c++ \
31+
gettext \
3132
git \
3233
gtk4-devel \
3334
gtksourceview5-devel \

.github/workflows/release-windows.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
update: true
5757
install: >-
5858
git
59+
gettext
5960
mingw-w64-clang-x86_64-gtk4
6061
mingw-w64-clang-x86_64-gtksourceview5
6162
mingw-w64-clang-x86_64-libadwaita
@@ -109,6 +110,8 @@ jobs:
109110
cp -r /clang64/share/themes "$bundle/share/" || true
110111
mkdir -p "$bundle/share/aetheris"
111112
cp data/style.css "$bundle/share/aetheris/style.css"
113+
mkdir -p "$bundle/share/locale/pt_BR/LC_MESSAGES"
114+
cp po/pt_BR/LC_MESSAGES/org.luminusos.Aetheris.mo "$bundle/share/locale/pt_BR/LC_MESSAGES/org.luminusos.Aetheris.mo"
112115
cp -r /clang64/lib/gdk-pixbuf-2.0 "$bundle/lib/" || true
113116
cp -r /clang64/lib/gio "$bundle/lib/" || true
114117
cp /clang64/ssl/certs/ca-bundle.crt "$bundle/ssl/certs/" 2>/dev/null || true

Cargo.lock

Lines changed: 106 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build-aux/compile-translations.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env sh
2+
set -eu
3+
4+
domain="org.luminusos.Aetheris"
5+
prefix="${1:-po}"
6+
7+
while IFS= read -r lang; do
8+
case "$lang" in
9+
""|\#*) continue ;;
10+
esac
11+
12+
install_dir="${prefix}/${lang}/LC_MESSAGES"
13+
mkdir -p "$install_dir"
14+
msgfmt "po/${lang}.po" -o "${install_dir}/${domain}.mo"
15+
done < po/LINGUAS

build-aux/org.luminusos.Aetheris.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"install -Dm644 data/style.css /app/share/aetheris/style.css",
5959
"install -Dm644 data/org.luminusos.Aetheris.desktop /app/share/applications/org.luminusos.Aetheris.desktop",
6060
"install -Dm644 data/org.luminusos.Aetheris.metainfo.xml /app/share/metainfo/org.luminusos.Aetheris.metainfo.xml",
61+
"install -Dm644 po/pt_BR/LC_MESSAGES/org.luminusos.Aetheris.mo /app/share/locale/pt_BR/LC_MESSAGES/org.luminusos.Aetheris.mo",
6162
"install -Dm644 data/icons/hicolor/64x64/apps/org.luminusos.Aetheris.png /app/share/icons/hicolor/64x64/apps/org.luminusos.Aetheris.png",
6263
"install -Dm644 data/icons/hicolor/128x128/apps/org.luminusos.Aetheris.png /app/share/icons/hicolor/128x128/apps/org.luminusos.Aetheris.png",
6364
"install -Dm644 data/icons/hicolor/256x256/apps/org.luminusos.Aetheris.png /app/share/icons/hicolor/256x256/apps/org.luminusos.Aetheris.png",

build-aux/update-po.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env sh
2+
set -eu
3+
4+
domain="org.luminusos.Aetheris"
5+
pot="po/${domain}.pot"
6+
7+
xgettext \
8+
--from-code=UTF-8 \
9+
--keyword=tr \
10+
--keyword=tr_format:1 \
11+
--keyword=trn:1,2 \
12+
--add-comments=Translators \
13+
--package-name=Aetheris \
14+
--output="$pot" \
15+
--files-from=po/POTFILES.in
16+
17+
while IFS= read -r lang; do
18+
case "$lang" in
19+
""|\#*) continue ;;
20+
esac
21+
22+
po_file="po/${lang}.po"
23+
if [ -f "$po_file" ]; then
24+
msgmerge --update --backup=none "$po_file" "$pot"
25+
else
26+
msginit --no-translator --locale="$lang" --input="$pot" --output-file="$po_file"
27+
fi
28+
done < po/LINGUAS

crates/aetheris-app/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ assets = [
2121
"../../data/icons/hicolor/256x256/apps/org.luminusos.Aetheris.png",
2222
"../../data/icons/hicolor/512x512/apps/org.luminusos.Aetheris.png",
2323
"../../data/icons/hicolor/symbolic/apps/org.luminusos.Aetheris-symbolic.svg",
24+
"../../po/pt_BR/LC_MESSAGES/org.luminusos.Aetheris.mo",
2425
]
2526
auto_link = true
2627
auto_link_exclude_list = [
@@ -49,6 +50,7 @@ resources = [
4950
"../../data/style.css",
5051
"../../data/org.luminusos.Aetheris.metainfo.xml",
5152
"../../data/icons/hicolor",
53+
"../../po/pt_BR/LC_MESSAGES/org.luminusos.Aetheris.mo",
5254
]
5355

5456
[dependencies]
@@ -67,3 +69,6 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
6769

6870
[target.'cfg(not(target_os = "windows"))'.dependencies]
6971
vte4 = "0.10"
72+
73+
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
74+
gettext-rs = { version = "0.7", features = ["gettext-system"] }

crates/aetheris-app/src/app.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ mod commands;
2424
mod component;
2525
mod dialogs;
2626
mod handler;
27+
pub(crate) mod i18n;
2728
mod layout;
2829
mod methods;
2930
mod object_detail;
@@ -34,6 +35,7 @@ mod utils;
3435
mod widgets;
3536
mod yaml;
3637

38+
use i18n::{tr, tr_format, trn};
3739
use projects::{
3840
DetailTarget, ObjectColumn, ObjectTableColumn, PodLogTarget, Project, ProjectStore,
3941
ResourceSection, StatusFilter,

0 commit comments

Comments
 (0)