-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Merge remote-tracking branch 'origin/main' into develop
- Loading branch information
Showing
17 changed files
with
16,265 additions
and
14,999 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
#!/bin/env python | ||
import os | ||
import sys | ||
from pathlib import Path | ||
import re | ||
|
||
""" | ||
GOAL take downloaded translation .po from transifex | ||
and create the js and JSON files. | ||
This should only be temporary as long as the sync does not work. | ||
""" | ||
|
||
cwd = os.getcwd() | ||
target_dir = 'l10n' | ||
|
||
print('Working in', cwd) | ||
|
||
if not os.path.isdir(os.path.join(cwd, target_dir)): | ||
print('{} does not exist, run this script from the root of your project'.format(target_dir)) | ||
|
||
def this_script_name(): | ||
return Path(sys.argv[0]).parts[-1] | ||
|
||
def usage(): | ||
print('{} <lang_code> </path/to/file.po>'.format(this_script_name())) | ||
sys.exit() | ||
|
||
if not len(sys.argv) == 3: | ||
usage() | ||
|
||
lang_code = sys.argv[1] | ||
po_file = sys.argv[2] | ||
|
||
if not Path(po_file).is_file(): | ||
print('{} does not exist'.format(po_file)) | ||
|
||
target_files = {} | ||
target_files['js'] = Path(os.path.join(cwd, target_dir, '{}.js'.format(lang_code))) | ||
target_files['json'] = Path(os.path.join(cwd, target_dir, '{}.json'.format(lang_code))) | ||
|
||
if target_files['js'].exists() or target_files['json'].exists(): | ||
print('{} related files exits'.format(lang_code)) | ||
sys.exit(1) | ||
|
||
f = open(po_file, 'r') | ||
|
||
lines = f.readlines() | ||
|
||
readnext = False | ||
lastid = None | ||
all_labels = {} | ||
|
||
for l in lines: | ||
line = l.strip().replace('\n', '') | ||
if line == '': | ||
continue | ||
|
||
if readnext or lastid: | ||
if line == 'msgid ""': | ||
# multiline msgid, not handled by this script | ||
readnext = False | ||
continue | ||
|
||
key, text = line.split(' "') | ||
|
||
if key == 'msgid': | ||
lastid = '"{}'.format(text) | ||
readnext = False | ||
if key == 'msgstr': | ||
all_labels[lastid] = '"{}'.format(text) | ||
lastid = None | ||
|
||
if re.fullmatch('#: /app/specialAppInfoFakeDummyForL10nScript.php:\d+', line): | ||
readnext = True | ||
continue | ||
|
||
if re.fullmatch('#: /app/src/fakeLabels.ts:\d+', line): | ||
readnext = True | ||
continue | ||
|
||
template = {} | ||
template['js'] = """ | ||
OC.L10N.register( | ||
"thesearchpage", | ||
{ | ||
%%translations%% | ||
}, | ||
"nplurals=2; plural=(n != 1);"); | ||
""" | ||
|
||
template['json'] = """ | ||
{ "translations": { | ||
%%translations%% | ||
},"pluralForm" :"nplurals=2; plural=(n != 1);" | ||
} | ||
""" | ||
|
||
translations = [] | ||
|
||
for k in all_labels: | ||
translations.append('{}: {}'.format(k, all_labels[k])) | ||
|
||
|
||
for ext in template: | ||
f = open(target_files[ext].as_posix(), mode='w') | ||
f.write(template[ext].replace('%%translations%%', ",\n ".join(translations))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
|
||
OC.L10N.register( | ||
"thesearchpage", | ||
{ | ||
"The Search Page" : "Die Suchseite" | ||
"The Search Page": "Die Suchseite", | ||
"Provides a proper search page": "Bietet eine richtige Suchseite an", | ||
"All providers": "Alle Anbieter", | ||
"Back": "Zurück", | ||
"Clear current query": "Aktuelle Abfrage löschen", | ||
"Click to change providers": "Hier klicken um Anbieter zu wechseln", | ||
"Filters": "Filter", | ||
"Load more...": "Weitere laden…", | ||
"Loading...": "Lade…", | ||
"No results": "Keine Ergebnisse", | ||
"Search": "Suche", | ||
"Search Page": "Suchseite", | ||
"See all providers": "Alle Anbieter anzeigen", | ||
"See only results for this provider": "Nur Ergebnisse für diesen Anbieter anzeigen", | ||
"Show only": "Nur anzeigen", | ||
"There was an error loading the providers.": "Beim Laden der Anbieter ist ein Fehler aufgetreten." | ||
}, | ||
"nplurals=2; plural=(n != 1);"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
|
||
{ "translations": { | ||
"The Search Page" : "Die Suchseite" | ||
"The Search Page": "Die Suchseite", | ||
"Provides a proper search page": "Bietet eine richtige Suchseite an", | ||
"All providers": "Alle Anbieter", | ||
"Back": "Zurück", | ||
"Clear current query": "Aktuelle Abfrage löschen", | ||
"Click to change providers": "Hier klicken um Anbieter zu wechseln", | ||
"Filters": "Filter", | ||
"Load more...": "Weitere laden…", | ||
"Loading...": "Lade…", | ||
"No results": "Keine Ergebnisse", | ||
"Search": "Suche", | ||
"Search Page": "Suchseite", | ||
"See all providers": "Alle Anbieter anzeigen", | ||
"See only results for this provider": "Nur Ergebnisse für diesen Anbieter anzeigen", | ||
"Show only": "Nur anzeigen", | ||
"There was an error loading the providers.": "Beim Laden der Anbieter ist ein Fehler aufgetreten." | ||
},"pluralForm" :"nplurals=2; plural=(n != 1);" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
OC.L10N.register( | ||
"thesearchpage", | ||
{ | ||
"The Search Page": "Page de recherche", | ||
"Provides a proper search page": "Fournit une page de recherche", | ||
"All providers": "Tous les fournisseurs", | ||
"Back": "Retour", | ||
"Clear current query": "Effacer la recherche courante", | ||
"Click to change providers": "Cliquer pour changer les fournisseurs", | ||
"Filters": "Filtres", | ||
"Load more...": "Charger plus...", | ||
"Loading...": "Chargement...", | ||
"No results": "Aucun résultat", | ||
"Search": "Rechercher", | ||
"Search Page": "Page de recherche", | ||
"See all providers": "Voir tous les fournisseurs", | ||
"See only results for this provider": "Voir seulement les résultats de ce fournisseur", | ||
"Show only": "Isoler", | ||
"There was an error loading the providers.": "Il y a eu une erreur au chargement de la liste des fournisseurs" | ||
}, | ||
"nplurals=2; plural=(n != 1);"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
{ "translations": { | ||
"The Search Page": "Page de recherche", | ||
"Provides a proper search page": "Fournit une page de recherche", | ||
"All providers": "Tous les fournisseurs", | ||
"Back": "Retour", | ||
"Clear current query": "Effacer la recherche courante", | ||
"Click to change providers": "Cliquer pour changer les fournisseurs", | ||
"Filters": "Filtres", | ||
"Load more...": "Charger plus...", | ||
"Loading...": "Chargement...", | ||
"No results": "Aucun résultat", | ||
"Search": "Rechercher", | ||
"Search Page": "Page de recherche", | ||
"See all providers": "Voir tous les fournisseurs", | ||
"See only results for this provider": "Voir seulement les résultats de ce fournisseur", | ||
"Show only": "Isoler", | ||
"There was an error loading the providers.": "Il y a eu une erreur au chargement de la liste des fournisseurs" | ||
},"pluralForm" :"nplurals=2; plural=(n != 1);" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
OC.L10N.register( | ||
"thesearchpage", | ||
{ | ||
"The Search Page": "Arama sayfası", | ||
"Provides a proper search page": "Düzgün bir arama sayfası sağlar", | ||
"All providers": "Tüm hizmet sağlayıcıları", | ||
"Back": "Geri", | ||
"Clear current query": "Geçerli sorguyu temizle", | ||
"Click to change providers": "Hizmet sağlayıcıları değiştirmek için tıklayın", | ||
"Filters": "Süzgeçler", | ||
"Load more...": "Diğerlerini yükle...", | ||
"Loading...": "Yükleniyor...", | ||
"No results": "Herhangi bir sonuç bulunamadı", | ||
"Search": "Ara", | ||
"Search Page": "Arama sayfası", | ||
"See all providers": "Tüm hizmet sağlayıcıları görüntüle", | ||
"See only results for this provider": "Yalnızca bu hizmet sağlayıcının sonuçlarını görüntüle", | ||
"Show only": "Yalnızca şunlar görüntülensin", | ||
"There was an error loading the providers.": "Hizmet sağlayıcılar yüklenirken sorun çıktı." | ||
}, | ||
"nplurals=2; plural=(n != 1);"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
{ "translations": { | ||
"The Search Page": "Arama sayfası", | ||
"Provides a proper search page": "Düzgün bir arama sayfası sağlar", | ||
"All providers": "Tüm hizmet sağlayıcıları", | ||
"Back": "Geri", | ||
"Clear current query": "Geçerli sorguyu temizle", | ||
"Click to change providers": "Hizmet sağlayıcıları değiştirmek için tıklayın", | ||
"Filters": "Süzgeçler", | ||
"Load more...": "Diğerlerini yükle...", | ||
"Loading...": "Yükleniyor...", | ||
"No results": "Herhangi bir sonuç bulunamadı", | ||
"Search": "Ara", | ||
"Search Page": "Arama sayfası", | ||
"See all providers": "Tüm hizmet sağlayıcıları görüntüle", | ||
"See only results for this provider": "Yalnızca bu hizmet sağlayıcının sonuçlarını görüntüle", | ||
"Show only": "Yalnızca şunlar görüntülensin", | ||
"There was an error loading the providers.": "Hizmet sağlayıcılar yüklenirken sorun çıktı." | ||
},"pluralForm" :"nplurals=2; plural=(n != 1);" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
OC.L10N.register( | ||
"thesearchpage", | ||
{ | ||
"The Search Page": "Пошукова сторінка", | ||
"Provides a proper search page": "Надає результати пошуку", | ||
"All providers": "Все", | ||
"Back": "Назад", | ||
"Clear current query": "Очистити поточний запит", | ||
"Click to change providers": "Клацніть, щоб змінити постачальників даних", | ||
"Filters": "Фільтри", | ||
"Load more...": "Більше...", | ||
"Loading...": "Завантаження...", | ||
"No results": "Нічого не знайдено", | ||
"Search": "Пошук", | ||
"Search Page": "Пошук", | ||
"See all providers": "Показати розширені результати пошуку", | ||
"See only results for this provider": "Показати відфільтровані результати пошуку", | ||
"Show only": "Перейти", | ||
"There was an error loading the providers.": "Помилка під час завантаження постачальників даних." | ||
}, | ||
"nplurals=2; plural=(n != 1);"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
{ "translations": { | ||
"The Search Page": "Пошукова сторінка", | ||
"Provides a proper search page": "Надає результати пошуку", | ||
"All providers": "Все", | ||
"Back": "Назад", | ||
"Clear current query": "Очистити поточний запит", | ||
"Click to change providers": "Клацніть, щоб змінити постачальників даних", | ||
"Filters": "Фільтри", | ||
"Load more...": "Більше...", | ||
"Loading...": "Завантаження...", | ||
"No results": "Нічого не знайдено", | ||
"Search": "Пошук", | ||
"Search Page": "Пошук", | ||
"See all providers": "Показати розширені результати пошуку", | ||
"See only results for this provider": "Показати відфільтровані результати пошуку", | ||
"Show only": "Перейти", | ||
"There was an error loading the providers.": "Помилка під час завантаження постачальників даних." | ||
},"pluralForm" :"nplurals=2; plural=(n != 1);" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
OC.L10N.register( | ||
"thesearchpage", | ||
{ | ||
"The Search Page": "搜尋頁面", | ||
"Provides a proper search page": "提供適當的搜尋頁面", | ||
"All providers": "所有提供者", | ||
"Back": "上星期", | ||
"Clear current query": "清除目前的查詢", | ||
"Click to change providers": "點擊以變更提供者", | ||
"Filters": "過濾", | ||
"Load more...": "載入更多…", | ||
"Loading...": "加載中...", | ||
"No results": "沒有結果", | ||
"Search": "搜尋", | ||
"Search Page": "搜尋頁面", | ||
"See all providers": "檢視所有提供者", | ||
"See only results for this provider": "僅檢視該提供者的結果", | ||
"Show only": "僅顯示", | ||
"There was an error loading the providers.": "載入提供者時發生錯誤。" | ||
}, | ||
"nplurals=2; plural=(n != 1);"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
{ "translations": { | ||
"The Search Page": "搜尋頁面", | ||
"Provides a proper search page": "提供適當的搜尋頁面", | ||
"All providers": "所有提供者", | ||
"Back": "上星期", | ||
"Clear current query": "清除目前的查詢", | ||
"Click to change providers": "點擊以變更提供者", | ||
"Filters": "過濾", | ||
"Load more...": "載入更多…", | ||
"Loading...": "加載中...", | ||
"No results": "沒有結果", | ||
"Search": "搜尋", | ||
"Search Page": "搜尋頁面", | ||
"See all providers": "檢視所有提供者", | ||
"See only results for this provider": "僅檢視該提供者的結果", | ||
"Show only": "僅顯示", | ||
"There was an error loading the providers.": "載入提供者時發生錯誤。" | ||
},"pluralForm" :"nplurals=2; plural=(n != 1);" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,4 @@ public function getPriority() | |
// TODO: Implement getPriority() method. | ||
return 50; | ||
} | ||
} | ||
} |
Oops, something went wrong.