Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n #60

Merged
merged 5 commits into from
May 5, 2024
Merged

i18n #60

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ sealed class LanguagesPreference(val value: Int) {
object UseDeviceLanguages : LanguagesPreference(0)
object English : LanguagesPreference(1)
object ChineseSimplified : LanguagesPreference(2)
object Farsi : LanguagesPreference(3)
object Russian : LanguagesPreference(4)

fun put(context: Context, scope: CoroutineScope) {
scope.launch {
Expand All @@ -32,13 +34,17 @@ sealed class LanguagesPreference(val value: Int) {
UseDeviceLanguages -> context.getString(R.string.use_device_languages)
English -> context.getString(R.string.english)
ChineseSimplified -> context.getString(R.string.chinese_simplified)
Farsi -> context.getString(R.string.farsi)
Russian -> context.getString(R.string.russian)
}

fun getLocale(): Locale =
when (this) {
UseDeviceLanguages -> LocaleList.getDefault().get(0)
English -> Locale("en", "US")
ChineseSimplified -> Locale("zh", "CN")
Farsi -> Locale("fa", "IR")
Russian -> Locale("ru", "RU")
}

fun setLocale(context: Context) {
Expand All @@ -65,14 +71,18 @@ sealed class LanguagesPreference(val value: Int) {
val values = listOf(
UseDeviceLanguages,
English,
ChineseSimplified
ChineseSimplified,
Farsi,
Russian
)

fun fromPreferences(preferences: Preferences): LanguagesPreference =
when (preferences[DataStoreKeys.Languages.key]) {
0 -> UseDeviceLanguages
1 -> English
2 -> ChineseSimplified
3 -> Farsi
4 -> Russian
else -> default
}

Expand All @@ -81,6 +91,8 @@ sealed class LanguagesPreference(val value: Int) {
0 -> UseDeviceLanguages
1 -> English
2 -> ChineseSimplified
3 -> Farsi
4 -> Russian
else -> default
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<string name="color_and_style_setting_desc">پوسته، رنگ سبک</string>
<string name="about">درباره</string>
<string name="about_setting_desc">نسخه، موضوع، اعتبار</string>
<string name="languages">زبانها</string>
<string name="languages">زبانها (Languages)</string>
<string name="use_device_languages">استفاده از زبان دستگاه</string>
<string name="languages_setting_desc">انگلیسی، چینی و بقیه</string>
<string name="english" translatable="false">English</string>
Expand Down
91 changes: 91 additions & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<resources>

<string name="new_note">Новая заметка</string>
<string name="desc_menu">Меню</string>
<string name="desc_sync">Синхронизация</string>
<string name="desc_more">Подробнее</string>
<string name="desc_search">Поиск</string>
<string name="all_notes">Все примечания</string>
<string name="title">Заголовок</string>
<string name="body">Текст</string>
<string name="folders">Папки</string>
<string name="new_folder">Новая папка</string>
<string name="confirm">Подтвердить</string>
<string name="cancel">Отменить</string>
<string name="delete">Удалить</string>
<string name="open">Открыть</string>
<string name="content">Содержимое</string>
<string name="sign_in">Войти</string>
<string name="url">URL</string>
<string name="email">Email</string>
<string name="password">Пароль</string>
<string name="conflict_notes">Конфликтующие заметки</string>
<string name="settings">Настройки</string>
<string name="back">Назад</string>
<string name="account">Учётная запись</string>
<string name="account_setting_desc">Синхронизация</string>
<string name="color_and_style">Цвет и стиль</string>
<string name="color_and_style_setting_desc">Тема, цветовой стиль</string>
<string name="about">О приложении</string>
<string name="about_setting_desc">Версия, выпуск, титры</string>
<string name="languages">Языки (Languages)</string>
<string name="use_device_languages">Использовать языки устройства</string>
<string name="languages_setting_desc">Английский, Китайский, Фарси, Русский и другие</string>


<string name="joplin_server">Сервер Joplin</string>
<string name="syncing">Синхронизация</string>
<string name="every_15_minutes">Каждые 15 минут</string>
<string name="every_30_minutes">Каждые 30 минут</string>
<string name="every_1_hour">Каждый час</string>
<string name="every_2_hours">Каждые 2 часа</string>
<string name="every_3_hours">Каждые 3 часа</string>
<string name="every_6_hours">Каждые 6 часов</string>
<string name="every_12_hours">Каждые 12 часов</string>
<string name="every_1_day">Каждый день</string>
<string name="manually">Вручную</string>
<string name="sync_interval">Синхронизировать</string>
<string name="sync_once_on_start">Синхронизировать при запуске</string>
<string name="only_on_wifi">Только по Wi-Fi</string>
<string name="only_when_charging">Только когда на зарядке</string>
<string name="tools">Инструменты</string>
<string name="tools_setting_des">Журнал, база данных и другое</string>
<string name="log">Журнал</string>
<string name="view_logs">Просмотр журналов</string>
<string name="coming_soon">Скоро будет</string>
<string name="login_tip">Пожалуйста введите данные для входа на ваш сервер Joplin.</string>
<string name="database_status">Статус базы данных</string>
<string name="database_status_desc">Просмотр статуса базы данных</string>
<string name="search">Поиск</string>
<string name="not_found">Не найдено заметок для "%s"</string>
<string name="searching">Поиск заметок с "%s"</string>
<string name="notes_loading">Загрузка заметок</string>
<string name="create_a_note">Создать заметку?</string>
<string name="ask_delete_folder_title">Удалить "%s"?</string>
<string name="ask_delete_folder_description">Все заметки и вложенные папки также будут удалены.</string>
<string name="edit_folder">Изменить папку</string>
<string name="resynchronize_from_scratch">Выполнить повторную синхронизацию с нуля</string>
<string name="edit">Изменить</string>
<string name="preview">Предпросмотр</string>
<string name="ask_delete_selected_notes">Удалить выбранные заметки?</string>

<string name="readme_desc">Смотрите репозиторий на GitHub и его README</string>
<string name="release_desc">Смотрите список изменений и новые версии</string>
<string name="release">Последняя версия</string>
<string name="credits">Авторы</string>
<string name="credits_desc">Авторы и лицензии</string>
<string name="version">Версия</string>
<string name="github_issue">Багтрекер на GitHub</string>
<string name="github_issue_desc">Отправьте сообщение о проблеме или запрос новой функциональности</string>
<string name="info_copied">Информация скопирована в буфер обмена</string>
<string name="sync_failed">Ошибка синхронизации</string>
<string name="dark_theme">Тёмная тема</string>
<string name="high_contrast">Высококонтрастная тёмная тема</string>
<string name="use_device_theme">Использовать тему устройства</string>
<string name="on">Включить</string>
<string name="off">Выключить</string>
<string name="other">Другое</string>
<string name="content_text_direction">Направление текста содержимого</string>
<string name="content_text_direction_desc">Направление текста в заметках, заголовках и т.д.</string>
<string name="auto">Авто</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<string name="color_and_style_setting_desc">主题、色调样式</string>
<string name="about">关于</string>
<string name="about_setting_desc">版本、反馈、致谢</string>
<string name="languages">语言</string>
<string name="languages">语言 (Languages)</string>
<string name="languages_setting_desc">英语、简体中文、更多</string>
<string name="joplin_server">Joplin 服务器</string>
<string name="syncing">同步</string>
Expand Down
20 changes: 11 additions & 9 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@
<string name="url">URL</string>
<string name="email">Email</string>
<string name="password">Password</string>
<string name="conflict_notes">Conflict Notes</string>
<string name="conflict_notes">Conflicting Notes</string>
<string name="settings">Settings</string>
<string name="back">Back</string>
<string name="account">Account</string>
<string name="account_setting_desc">Syncing</string>
<string name="color_and_style">Color &amp; Style</string>
<string name="color_and_style_setting_desc">Theme, color style</string>
<string name="about">About</string>
<string name="about">About the app</string>
<string name="about_setting_desc">Version, issue, credits</string>
<string name="languages">Languages</string>
<string name="use_device_languages">Use Device Languages</string>
<string name="languages_setting_desc">English, Chinese, more</string>
<string name="languages_setting_desc">English, Chinese, Farsi, Russian, more</string>
<string name="english" translatable="false">English</string>
<string name="chinese_simplified" translatable="false">简体中文</string>
<string name="farsi" translatable="false">فارسی</string>
<string name="russian" translatable="false">Русский</string>
<string name="joplin_server">Joplin Server</string>
<string name="syncing">Syncing</string>
<string name="every_15_minutes">Every 15 minutes</string>
Expand Down Expand Up @@ -69,14 +71,14 @@
<string name="preview">Preview</string>
<string name="ask_delete_selected_notes">Delete selected notes?</string>
<string name="readme" translatable="false">README</string>
<string name="readme_desc">Check the GitHub repository and the README</string>
<string name="release_desc">Look for changelogs and new versions</string>
<string name="readme_desc">See the GitHub repository and its the README</string>
<string name="release_desc">See the changelog and new versions</string>
<string name="release">Latest release</string>
<string name="credits">Credits</string>
<string name="credits_desc">Credits and libre software</string>
<string name="credits">Authors</string>
<string name="credits_desc">Copyright and licenses</string>
<string name="version">Version</string>
<string name="github_issue">GitHub issue</string>
<string name="github_issue_desc">Submit an issue for bug report or feature request</string>
<string name="github_issue">GitHub issues</string>
<string name="github_issue_desc">Submit a bug report or a feature request</string>
<string name="info_copied">Info copied to clipboard</string>
<string name="sync_failed">Sync failed</string>
<string name="dark_theme">Dark Theme</string>
Expand Down
6 changes: 3 additions & 3 deletions fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
It is currently in the beta stage, so take care to make backups.

Supported features:
<b>Supported features:</b>

✅ Create, modify and delete folders and notes
✅ Markdown editor with toolbar
✅ Full-text search using jieba-rs (Chinese and English supported)
✅ Sync notes using a self-hosted Joplin server
✅ Manual and automatic synchronization
🚧 Possible compatibility with Joplin's sync format (End-to-end encryption is not supported)

<b>It is currently in the beta stage, so take care to make backups.</b>
10 changes: 10 additions & 0 deletions fastlane/metadata/android/ru/full_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<b>Поддерживаемые возможности:</b>

✅ Создавать, изменять и удалять папки и заметки
✅ Редактор Markdown с панелью инструментов
✅ Полнотекстовый поиск с использованием jieba-rs
✅ Синхронизируйте заметки со своим сервером Joplin
✅ Ручная и автоматическая синхронизация
🚧 Возможна совместимость с форматом синхронизации Joplin (сквозное шифрование не поддерживается)

<b>В настоящее время программа находится в стадии бета-тестирования, поэтому позаботьтесь о создании резервных копий.</b>
1 change: 1 addition & 0 deletions fastlane/metadata/android/ru/short_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Приложение для заметок с поддержкой синхронизации со своим сервером Joplin
6 changes: 3 additions & 3 deletions fastlane/metadata/android/zh-CN/full_description.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
目前处于测试阶段,注意做好备份。

已支持的功能:
<b>已支持的功能:</b>

✅ 创建、修改和删除文件夹和笔记
✅ 带有工具栏的 Markdown 编辑器
✅ 基于 jieba-rs 的全文搜索(支持中文和英文)
✅ 使用本地部署的 Joplin 服务器同步笔记
✅ 手动和自动同步
🚧 可能兼容 Joplin 的同步格式(不支持端到端加密)

<b>目前处于测试阶段,注意做好备份。</b>
Loading