From a0e6ca1cb8795110a68c6a3eb2b4480d97397705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCrten?= <sebastian@mobanisto.de> Date: Thu, 2 Dec 2021 19:35:09 +0100 Subject: [PATCH] Add hacking guide --- HACKING.md | 26 ++++++++++++++++++++++++++ README.md | 5 +++++ TRANSLATION.md | 3 +++ 3 files changed, 34 insertions(+) create mode 100644 HACKING.md diff --git a/HACKING.md b/HACKING.md new file mode 100644 index 0000000000..7d59083a61 --- /dev/null +++ b/HACKING.md @@ -0,0 +1,26 @@ +# Hacking guide + +## Testing different locales + +To test the app with a different locale, add this e.g. in `Main.kt`: + +``` +Locale.setDefault(Locale("ar")) +``` + +and replace `ar` with a different language you would like to test, such as +Arabic in this example. + +It is also possible to run from the command line using Gradle with a +different language setting: + +``` +GRADLE_OPTS="-Duser.language=fr -Duser.country=FR" ./gradlew run +``` + +## Threading + +Some rules about threading in Briar Desktop: + +* Always use local variables instead of the composable State objects inside + another thread: [Source](https://code.briarproject.org/briar/briar-desktop/-/merge_requests/55#note_57632) diff --git a/README.md b/README.md index d34431d1fc..04af8e0ae2 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,11 @@ If you want to use the JDKs downloaded by Intellij IDEA, you can for example spe See [TRANSLATION.md](./TRANSLATION.md) for more information. +## Hacking + +See [HACKING.md](./HACKING.md) for useful information when trying to work +with the source code. + ## Maintenance From time to time, translations and Flatpak's dependencies should be diff --git a/TRANSLATION.md b/TRANSLATION.md index a8e8fdb8b3..97b7ca12c6 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -32,3 +32,6 @@ flatpak-builder: ``` --env=LC_ALL=de_DE.utf8 ``` + +There's also a section in [HACKING.md](./HACKING.md#testing-different-locales) +dedicated to testing of different locales in order to try out translations. -- GitLab