Skip to content

Commit

Permalink
Merge pull request #98 from Psiphon-Inc/e.fryntov/translation-improve…
Browse files Browse the repository at this point in the history
…ments

Translation improvements
  • Loading branch information
efryntov authored Jan 23, 2025
2 parents 23166a8 + 94156c6 commit 231bc39
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 37 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ For more information about Conduit, [visit the web site](https://conduit.psiphon

This project uses [Git LFS](https://git-lfs.github.com/) to manage large files such as the tunnel core libraries.

## Translations

For information about pulling and verifying translations, see [i18n/README.md](i18n/README.md).

12 changes: 12 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ android {
buildFeatures {
aidl true
}

lintOptions {
// Make translation issues fatal
fatal 'StringFormatInvalid', 'StringFormatMatches'
}
}

// Perform lint checks before any assemble task
tasks.configureEach { task ->
if (task.name.contains("assemble")) {
task.dependsOn 'lint'
}
}

// Apply static values from `gradle.properties` to the `android.packagingOptions`
Expand Down
11 changes: 3 additions & 8 deletions android/app/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<resources>
<string name="app_name">Conduit</string>
<string name="expo_splash_screen_resize_mode" translatable="false">contain</string>
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string>
<string name="expo_system_ui_user_interface_style" translatable="false">automatic</string>
<!-- Label for the stop action in the Conduit service notification -->
<string name="conduit_service_stop_label_text">توقف</string>
<!-- Short notification text (notification collapsed) for the Conduit service when it is active showing the number of clients connected, connecting, and total bytes transferred -->
<string name="conduit_service_running_notification_short_text">۱\n۲\n۳</string>
<string name="conduit_service_running_notification_short_text">%1$d / %2$d \u00B7 %3$s</string>
<!-- Long notification text (notification expanded) for the Conduit service when it is active showing the number of clients connected, connecting, and total bytes transferred -->
<string name="conduit_service_running_notification_long_text">اتصال فعال %1$d\nدر حال اتصال %2$d\nانتقال داده شد %3$s</string>
<string name="conduit_service_running_notification_long_text">اتصال فعال %1$d / در حال اتصال %2$d\nانتقال داده شد %3$s</string>
<!-- Notification text for the Conduit service when it is waiting for network connectivity -->
<string name="conduit_service_no_internet_notification_text">منتظر اتصال به شبکه</string>
<!-- Notification channel description for the Conduit service -->
Expand All @@ -21,6 +18,4 @@
<string name="notification_conduit_failed_to_restart_text">Conduit راه نیفتاد. برای اطلاعات بیشتر اینجا کلیک کنید. </string>
<!-- Notification text for Conduit starting notification -->
<string name="conduit_service_starting_notification_text">Conduit در حال شروع است...</string>
<!-- Added by expo-localiztion -->
<string name="ExpoLocalization_supportsRTL" translatable="false">true</string>
</resources>
</resources>
26 changes: 0 additions & 26 deletions android/app/src/main/res/values-pt-rPT/strings.xml

This file was deleted.

29 changes: 29 additions & 0 deletions i18n/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# i18n

⚠️ **Important Notes:**
- Lint checks only verify Android translations
- React Native (Conduit core) translations are not verified

## Setup
1. Create `transifex_api_token` file in this directory (this file is gitignored)
2. Place your Transifex API token in this file

## Workflow Steps

1. Pull translations:
```bash
uv run transifex_pull.py
```

2. Check translation quality:
```bash
cd ../android
./gradlew lint
```

3. If lint fails:
- Fix or delete problematic translations
- Rerun lint until it passes
- Then try building the app

4. If all checks pass, commit the changes
6 changes: 3 additions & 3 deletions src/i18n/locales/fa/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"developer_comment": "Text displayed to the user to indicate their Conduit ID. The name 'Conduit' is the app name and should not be translated."
},
"TOTAL_BYTES_TRANSFERRED_I18N": {
"string": "منتقل شده {{ niceBytes }}"
"string": "{{ niceBytes }} منتقل شده"
},
"CONNECTED_PEERS_I18N": {
"string": "کاربران متصل {{ peers }}"
"string": "{{ peers }} کاربران متصل"
},
"CONNECTING_PEERS_I18N": {
"string": "در حال اتصال {{ peers }}"
"string": "{{ peers }} در حال اتصال"
},
"CANCEL_I18N": {
"string": "لغو کنید"
Expand Down

0 comments on commit 231bc39

Please sign in to comment.