[pitivi] bin: Unset LC_ALL when developing
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] bin: Unset LC_ALL when developing
- Date: Sat, 17 Feb 2018 15:19:17 +0000 (UTC)
commit a711b488b8a51969568c45444bcb5edf089a8292
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Sat Feb 17 15:54:34 2018 +0100
bin: Unset LC_ALL when developing
It's set when entering the sandbox to en_US.UTF-8, and this prevents the
LANG env var to have effect.
bin/pitivi.in | 9 +++++++++
docs/HACKING.md | 20 ++++++++++++++++++++
2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/bin/pitivi.in b/bin/pitivi.in
index 2e3420a..2be8a83 100755
--- a/bin/pitivi.in
+++ b/bin/pitivi.in
@@ -94,6 +94,15 @@ def _add_pitivi_path():
sys.path.append(path)
# i18n
+ if _in_devel():
+ # LC_ALL is set to en_US.UTF-8 by flatpak builder which is used
+ # when developers run Pitivi in the development sandbox.
+ # We don't need to use LC_ALL when developing, so unset it
+ # to avoid being surprised that setting LANG does not work.
+ try:
+ del os.environ["LC_ALL"]
+ except KeyError:
+ pass
localedir = os.path.join(DATADIR, "locale")
try:
gettext.bindtextdomain("pitivi", localedir)
diff --git a/docs/HACKING.md b/docs/HACKING.md
index 1c9f2f0..f1eaaab 100644
--- a/docs/HACKING.md
+++ b/docs/HACKING.md
@@ -162,3 +162,23 @@ You can then inspect the call tree profile with your preferred image viewer:
```
$ xdg-open profile.svg
```
+
+
+## Switching locales
+
+To see how Pitivi looks in a different locale, use:
+
+```
+(ptv-flatpak) $ LANG=fr_FR.UTF-8 pitivi
+```
+
+Pay attention the translations in the sandbox are not automatically
+updated when you `git pull`. You can update them by updating your
+sandbox (`ptvenv --update`) or by reinstalling Pitivi in the sandbox:
+
+```
+(ptv-flatpak) $ binstall
+[...]
+Installing /.../pitivi-dev/pitivi/mesonbuild/po/de.gmo to /app/share/locale/de/LC_MESSAGES/pitivi.mo
+[...]
+```
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]