feat(i18n): implement pluralization logic (#277)

Co-authored-by: welpo <welpo@users.noreply.github.com>
main
Mohammed Alotaibi 1 year ago committed by GitHub
parent daef40338c
commit c4893d4fdd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -12,9 +12,9 @@ full_stop = "." # Used at the end of a sentence.
blog = "التدوينات" blog = "التدوينات"
archive = "الأرشيف" archive = "الأرشيف"
tags = "الوسوم" tags = "الوسوم"
projects = "مشاريعي" # Change this to "المشاريع" if the site is for an organization. projects = "مشاريعي" #Change this to "المشاريع" if the site is for an organization.
about = "عني" # Change this to "عنا" or "من نحن" if the site is for an organization. about = "عني" #Change this to "عنا" or "من نحن" if the site is for an organization.
contact = "تواصل معي" # Change this to "تواصل معنا" if the site is for an organization. contact = "تواصل معي" #Change this to "تواصل معنا" if the site is for an organization.
privacy = "الخصوصية" privacy = "الخصوصية"
site_statistics = "إحصائيات المدونة" site_statistics = "إحصائيات المدونة"
sitemap = "خريطة المدونة" sitemap = "خريطة المدونة"
@ -23,13 +23,18 @@ sitemap = "خريطة المدونة"
search = "بحث" search = "بحث"
search_icon_title = "أنقر هنا أو اضغط $SHORTCUT لفتح البحث" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "أنقر هنا أو اضغط $SHORTCUT لفتح البحث" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "مسح البحث" clear_search = "مسح البحث"
result = "نتيجة" # "1 result" zero_results = "لم يتم العثور على نتائج" #No search results.
results = "نتائج" # "3 results" (also used for 0 results). one_results = "تم العثور على نتيجة واحدة" # One search result.
two_results = "تم العثور على نتيجتين" # Two search results.
few_results = "تم العثور على $NUMBER نتائج" # for 3 to 10 search results.
many_results = "تم العثور على $NUMBER نتيجة" # 11 or more search results.
# Navigation. # Navigation.
read_more = "إقرأ المزيد" read_more = "إقرأ المزيد"
post = "تدوينة" one_posts = "تدوينة واحدة" #One blog post.
posts = "تدوينات" # Plural of "post". two_posts = "تدوينتين" #Two blog posts.
few_posts = "$NUMBER تدوينات" #3 to 10 blog posts.
many_posts = "$NUMBER تدوينة" #11 or more blog posts.
prev = "السابق" # As in "Previous" page. prev = "السابق" # As in "Previous" page.
next = "التالي" # As in "Next" page. next = "التالي" # As in "Next" page.
of = "من" # E.g. Page 1 "of" 3 of = "من" # E.g. Page 1 "of" 3
@ -48,8 +53,18 @@ go_to_comments = "انتقل إلى التعليقات"
# Post metadata. # Post metadata.
draft = "مسودة" draft = "مسودة"
min_read = "دقيقة متوقعة للقراءة" zero_min_read = "الوقت المتوقع للقراءة: أقل من دقيقة" #Less than one minute read.
words = "كلمة" one_min_read = "الوقت المتوقع للقراءة: دقيقة واحدة" #One minute read.
two_min_read = "الوقت المتوقع للقراءة: دقيقتان" #Two minutes read.
few_min_read = "الوقت المتوقع للقراءة: $NUMBER دقائق" #3 to 10 minutes read.
many_min_read = "الوقت المتوقع للقراءة: $NUMBER دقيقة" #11 or more minutes read.
zero_words = "لا توجد كلمات" # No words.
one_words = "كلمة واحدة" # One word.
two_words = "كلمتين" # Two words.
few_words = "$NUMBER كلمات" # 3 to 10 words.
many_words = "$NUMBER كلمة" # 11 or more words.
last_updated_on = "آخر تحديث كان في" last_updated_on = "آخر تحديث كان في"
see_changes = "الإطلاع على التغييرات" see_changes = "الإطلاع على التغييرات"

@ -18,13 +18,14 @@ sitemap = "mapa del lloc"
search = "Cercar" search = "Cercar"
search_icon_title = "Fes clic o prem $SHORTCUT per obrir la cerca" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "Fes clic o prem $SHORTCUT per obrir la cerca" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "Esborrar cerca" # Title of the X icon next to search input. clear_search = "Esborrar cerca" # Title of the X icon next to search input.
result = "resultat" # "1 result" zero_results = "No s'han trobat resultats"
results = "resultats" # "3 results" (also used for 0 results). one_results = "$NUMBER resultat" # "1 result"
many_results = "$NUMBER resultats" # "3 results"
# Navigation. # Navigation.
read_more = "Llegir més" read_more = "Llegir més"
post = "entrada" one_posts = "$NUMBER entrada"
posts = "entrades" # Plural of "post". many_posts = "$NUMBER entrades"
prev = "Anterior" # As in "Previous" page. prev = "Anterior" # As in "Previous" page.
next = "Següent" # As in "Next" page. next = "Següent" # As in "Next" page.
of = "de" # E.g. Page 1 "of" 3 of = "de" # E.g. Page 1 "of" 3
@ -43,8 +44,12 @@ go_to_comments = "Vés a la secció de comentaris"
# Post metadata. # Post metadata.
draft = "ESBORRANY" draft = "ESBORRANY"
min_read = "min de lectura" zero_min_read = "<1 min de lectura"
words = "paraules" one_min_read = "$NUMBER min de lectura"
many_min_read = "$NUMBER mins de lectura"
zero_words = "Cap paraula"
one_words = "$NUMBER paraula"
many_words = "$NUMBER paraules"
last_updated_on = "Última actualizació el" last_updated_on = "Última actualizació el"
see_changes = "Veure canvis" see_changes = "Veure canvis"

@ -22,13 +22,14 @@ sitemap = "seitenübersicht"
search = "Suchen" search = "Suchen"
search_icon_title = "Klicken oder $SHORTCUT drücken, um die Suche zu öffnen" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "Klicken oder $SHORTCUT drücken, um die Suche zu öffnen" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "Suche löschen" # Title of the X icon next to search input. clear_search = "Suche löschen" # Title of the X icon next to search input.
result = "ergebnis" # "1 result" zero_results = "Keine Ergebnisse gefunden"
results = "ergebnisse" # "3 results" (also used for 0 results). one_results = "$NUMBER Ergebnis" # "1 result"
many_results = "$NUMBER Ergebnisse" # "3 results"
# Navigation. # Navigation.
read_more = "Weiterlesen" read_more = "Weiterlesen"
post = "beitrag" one_posts = "$NUMBER Beitrag"
posts = "beiträge" # Plural of "post". many_posts = "$NUMBER Beiträge"
prev = "Vorherig" # As in "Previous" page. prev = "Vorherig" # As in "Previous" page.
next = "Nächst" # As in "Next" page. next = "Nächst" # As in "Next" page.
of = "von" # E.g. Page 1 "of" 3 of = "von" # E.g. Page 1 "of" 3
@ -47,8 +48,12 @@ go_to_comments = "Zum Kommentarbereich"
# Post metadata. # Post metadata.
draft = "ENTWURF" draft = "ENTWURF"
min_read = "min. lesedauer" zero_min_read = "weniger als 1 Min. Lesezeit"
words = "wörter" one_min_read = "$NUMBER Min. Lesezeit"
many_min_read = "$NUMBER Min. Lesezeit"
zero_words = "Keine Wörter"
one_words = "$NUMBER Wort"
many_words = "$NUMBER Wörter"
last_updated_on = "Zuletzt aktualisiert am" last_updated_on = "Zuletzt aktualisiert am"
see_changes = "Änderungen anzeigen" see_changes = "Änderungen anzeigen"

@ -18,13 +18,14 @@ sitemap = "sitemap"
search = "Search" search = "Search"
search_icon_title = "Click or press $SHORTCUT to open search" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "Click or press $SHORTCUT to open search" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "Clear search" # Title of the X icon next to search input. clear_search = "Clear search" # Title of the X icon next to search input.
result = "result" # "1 result" zero_results = "No results"
results = "results" # "3 results" (also used for 0 results). one_results = "$NUMBER result" # "1 result"
many_results = "$NUMBER results" # "3 results"
# Navigation. # Navigation.
read_more = "Read more" read_more = "Read more"
post = "post" one_posts = "$NUMBER post"
posts = "posts" # Plural of "post". many_posts = "$NUMBER posts" # "3 posts"
prev = "Prev" # As in "Previous" page. prev = "Prev" # As in "Previous" page.
next = "Next" # As in "Next" page. next = "Next" # As in "Next" page.
of = "of" # E.g. Page 1 "of" 3 of = "of" # E.g. Page 1 "of" 3
@ -43,8 +44,12 @@ go_to_comments = "Go to the comments section"
# Post metadata. # Post metadata.
draft = "DRAFT" draft = "DRAFT"
min_read = "min read" zero_min_read = "<1 min read"
words = "words" one_min_read = "$NUMBER min read"
many_min_read = "$NUMBER min read"
zero_words = "No words"
one_words = "$NUMBER word"
many_words = "$NUMBER words"
last_updated_on = "Last updated on" last_updated_on = "Last updated on"
see_changes = "See changes" see_changes = "See changes"

@ -18,13 +18,14 @@ sitemap = "mapa del sitio"
search = "Buscar" search = "Buscar"
search_icon_title = "Haz clic o usa $SHORTCUT para abrir la búsqueda" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "Haz clic o usa $SHORTCUT para abrir la búsqueda" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "Borrar búsqueda" # Title of the X icon next to search input. clear_search = "Borrar búsqueda" # Title of the X icon next to search input.
result = "resultado" # "1 result" zero_results = "No hay resultados"
results = "resultados" # "3 results" (also used for 0 results). one_results = "$NUMBER resultado"
many_results = "$NUMBER resultados"
# Navigation. # Navigation.
read_more = "Leer más" read_more = "Leer más"
post = "entrada" one_posts = "$NUMBER entrada"
posts = "entradas" # Plural of "post". many_posts = "$NUMBER entradas"
prev = "Anterior" # As in "Previous" page. prev = "Anterior" # As in "Previous" page.
next = "Siguiente" # As in "Next" page. next = "Siguiente" # As in "Next" page.
of = "de" # E.g. Page 1 "of" 3 of = "de" # E.g. Page 1 "of" 3
@ -43,8 +44,12 @@ go_to_comments = "Ir a la sección de comentarios"
# Post metadata. # Post metadata.
draft = "BORRADOR" draft = "BORRADOR"
min_read = "min de lectura" zero_min_read = "<1 min de lectura"
words = "palabras" one_min_read = "$NUMBER min de lectura"
many_min_read = "$NUMBER mins de lectura"
zero_words = "Cero palabras"
one_words = "$NUMBER palabra"
many_words = "$NUMBER palabras"
last_updated_on = "Última actualización el" last_updated_on = "Última actualización el"
see_changes = "Ver cambios" see_changes = "Ver cambios"

@ -22,13 +22,14 @@ sitemap = "plan du site"
search = "Rechercher" search = "Rechercher"
search_icon_title = "Cliquez ou appuyez sur $SHORTCUT pour ouvrir la recherche" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "Cliquez ou appuyez sur $SHORTCUT pour ouvrir la recherche" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "Effacer la recherche" # Title of the X icon next to search input. clear_search = "Effacer la recherche" # Title of the X icon next to search input.
result = "résultat" # "1 result" zero_results = "Aucun résultat trouvé"
results = "résultats" # "3 results" (also used for 0 results). one_results = "$NUMBER résultat" # "1 result"
many_results = "$NUMBER résultats" # "3 results"
# Navigation. # Navigation.
read_more = "Lire plus" read_more = "Lire plus"
post = "article" one_posts = "$NUMBER article"
posts = "articles" # Plural of "post". many_posts = "$NUMBER articles"
prev = "Précédent" # As in "Previous" page. prev = "Précédent" # As in "Previous" page.
next = "Suivant" # As in "Next" page. next = "Suivant" # As in "Next" page.
of = "de" # E.g. Page 1 "of" 3 of = "de" # E.g. Page 1 "of" 3
@ -47,8 +48,12 @@ go_to_comments = "Aller à la section des commentaires"
# Post metadata. # Post metadata.
draft = "BROUILLON" draft = "BROUILLON"
min_read = "min de lecture" zero_min_read = "<1 min de lecture"
words = "mots" one_min_read = "$NUMBER min de lecture"
many_min_read = "$NUMBER min de lecture"
zero_words = "aucun mot"
one_words = "$NUMBER mot"
many_words = "$NUMBER mots"
last_updated_on = "Dernière mise à jour le" last_updated_on = "Dernière mise à jour le"
see_changes = "Voir les modifications" see_changes = "Voir les modifications"

@ -20,13 +20,14 @@ sitemap = "साइटमैप"
search = "खोजें" search = "खोजें"
search_icon_title = "$SHORTCUT दबाएँ या क्लिक करें खोज खोलने के लिए" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "$SHORTCUT दबाएँ या क्लिक करें खोज खोलने के लिए" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "खोज साफ करें" # Title of the X icon next to search input. clear_search = "खोज साफ करें" # Title of the X icon next to search input.
result = "परिणाम" # "1 result" zero_results = "कोई परिणाम नहीं मिला"
results = "परिणाम" # "3 results" (also used for 0 results). one_results = "$NUMBER परिणाम" # "1 result"
many_results = "$NUMBER परिणाम" # "3 results"
# Navigation. # Navigation.
read_more = "और पढ़ें" read_more = "और पढ़ें"
post = "पोस्ट" one_posts = "$NUMBER पोस्ट"
posts = "पोस्ट्स" # Plural of "post". many_posts = "$NUMBER पोस्ट्स"
prev = "पिछला" # As in "Previous" page. prev = "पिछला" # As in "Previous" page.
next = "अगला" # As in "Next" page. next = "अगला" # As in "Next" page.
of = "का" # E.g. Page 1 "of" 3 of = "का" # E.g. Page 1 "of" 3
@ -45,8 +46,12 @@ go_to_comments = "टिप्पणी अनुभाग में जाए
# Post metadata. # Post metadata.
draft = "मसौदा" draft = "मसौदा"
min_read = "मिनट पठन समय" zero_min_read = "कम से कम 1 मिनट पठन समय"
words = "शब्द" one_min_read = "$NUMBER मिनट पठन समय"
many_min_read = "$NUMBER मिनट पठन समय"
zero_words = "कोई शब्द नहीं"
one_words = "$NUMBER शब्द"
many_words = "$NUMBER शब्द"
last_updated_on = "आखिरी अपडेट" last_updated_on = "आखिरी अपडेट"
see_changes = "बदलाव देखें" see_changes = "बदलाव देखें"

@ -18,13 +18,14 @@ sitemap = "mappa del sito"
search = "Cerca" search = "Cerca"
search_icon_title = "Clicca o premi $SHORTCUT per aprire la ricerca" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "Clicca o premi $SHORTCUT per aprire la ricerca" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "Cancella ricerca" # Title of the X icon next to search input. clear_search = "Cancella ricerca" # Title of the X icon next to search input.
result = "risultato" # "1 result" zero_results = "Nessun risultato trovato"
results = "risultati" # "3 result" (also used for 0 results). one_results = "$NUMBER risultato"
many_results = "$NUMBER risultati"
# Navigation. # Navigation.
read_more = "Leggi di più" read_more = "Leggi di più"
post = "post" one_posts = "$NUMBER post"
posts = "post" # Plural of "post". many_posts = "$NUMBER post"
prev = "Precedente" # As in "Previous" page. prev = "Precedente" # As in "Previous" page.
next = "Successivo" # As in "Next" page. next = "Successivo" # As in "Next" page.
of = "di" # E.g. Page 1 "of" 3 of = "di" # E.g. Page 1 "of" 3
@ -43,8 +44,12 @@ go_to_comments = "Vai alla sezione commenti"
# Post metadata. # Post metadata.
draft = "BOZZA" draft = "BOZZA"
min_read = "min di lettura" zero_min_read = "<1 min di lettura"
words = "parole" one_min_read = "$NUMBER min di lettura"
many_min_read = "$NUMBER min di lettura"
zero_words = "Nessuna parola"
one_words = "$NUMBER parola"
many_words = "$NUMBER parole"
last_updated_on = "Ultimo aggiornamento il" last_updated_on = "Ultimo aggiornamento il"
see_changes = "Vedi modifiche" see_changes = "Vedi modifiche"

@ -22,13 +22,14 @@ sitemap = "サイトマップ"
search = "検索" search = "検索"
search_icon_title = "$SHORTCUTを押すか、クリックして検索を開く" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "$SHORTCUTを押すか、クリックして検索を開く" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "検索をクリア" # Title of the X icon next to search input. clear_search = "検索をクリア" # Title of the X icon next to search input.
result = "結果" # "1 result" zero_results = "結果が見つかりません"
results = "結果" # "3 results" (also used for 0 results). one_results = "$NUMBER 結果" # "1 result"
many_results = "$NUMBER 結果" # "3 results"
# Navigation. # Navigation.
read_more = "続きを読む" read_more = "続きを読む"
post = "投稿" one_posts = "$NUMBER 投稿"
posts = "投稿一覧" # Plural of "post". many_posts = "$NUMBER 投稿"
prev = "前" # As in "Previous" page. prev = "前" # As in "Previous" page.
next = "次" # As in "Next" page. next = "次" # As in "Next" page.
of = "中" # E.g. Page 1 "of" 3 of = "中" # E.g. Page 1 "of" 3
@ -47,8 +48,12 @@ go_to_comments = "コメントセクションへ"
# Post metadata. # Post metadata.
draft = "ドラフト" draft = "ドラフト"
min_read = "読了時間(分)" zero_min_read = "1分未満の読了時間"
words = "単語数" one_min_read = "$NUMBER 分の読了時間"
many_min_read = "$NUMBER 分の読了時間"
zero_words = "単語数ゼロ"
one_words = "$NUMBER 単語"
many_words = "$NUMBER 単語"
last_updated_on = "最終更新日" last_updated_on = "最終更新日"
see_changes = "変更を見る" see_changes = "変更を見る"

@ -22,13 +22,14 @@ sitemap = "사이트맵"
search = "검색" search = "검색"
search_icon_title = "클릭하거나 $SHORTCUT을 눌러 검색 열기" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "클릭하거나 $SHORTCUT을 눌러 검색 열기" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "검색 지우기" # Title of the X icon next to search input. clear_search = "검색 지우기" # Title of the X icon next to search input.
result = "결과" # "1 result" zero_results = "결과 없음"
results = "결과" # "3 results" (also used for 0 results). one_results = "$NUMBER 결과" # "1 result"
many_results = "$NUMBER 결과" # "3 results"
# Navigation. # Navigation.
read_more = "더 읽기" read_more = "더 읽기"
post = "게시물" one_posts = "$NUMBER 게시물"
posts = "게시물" # Plural of "post". many_posts = "$NUMBER 게시물"
prev = "이전" # As in "Previous" page. prev = "이전" # As in "Previous" page.
next = "다음" # As in "Next" page. next = "다음" # As in "Next" page.
of = "중" # E.g. Page 1 "of" 3 of = "중" # E.g. Page 1 "of" 3
@ -47,8 +48,12 @@ go_to_comments = "댓글 섹션으로"
# Post metadata. # Post metadata.
draft = "임시 저장" draft = "임시 저장"
min_read = "분 읽기" zero_min_read = "1분 미만 읽기"
words = "단어" one_min_read = "$NUMBER 분 읽기"
many_min_read = "$NUMBER 분 읽기"
zero_words = "단어 없음"
one_words = "$NUMBER 단어"
many_words = "$NUMBER 단어"
last_updated_on = "최근 업데이트" last_updated_on = "최근 업데이트"
see_changes = "변경사항 보기" see_changes = "변경사항 보기"

@ -18,13 +18,14 @@ sitemap = "mapa do site"
search = "Pesquisar" search = "Pesquisar"
search_icon_title = "Clique ou pressione $SHORTCUT para abrir a pesquisa" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "Clique ou pressione $SHORTCUT para abrir a pesquisa" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "Limpar pesquisa" # Title of the X icon next to search input. clear_search = "Limpar pesquisa" # Title of the X icon next to search input.
result = "resultado" # "1 result" zero_results = "Nenhum resultado encontrado"
results = "resultados" # "3 results" (also used for 0 results). one_results = "$NUMBER resultado" # "1 result"
many_results = "$NUMBER resultados" # "3 results"
# Navigation. # Navigation.
read_more = "Ler mais" read_more = "Ler mais"
post = "publicação" one_posts = "$NUMBER publicação"
posts = "publicações" # Plural of "post". many_posts = "$NUMBER publicações"
prev = "Anterior" # As in "Previous" page. prev = "Anterior" # As in "Previous" page.
next = "Seguinte" # As in "Next" page. next = "Seguinte" # As in "Next" page.
of = "de" # E.g. Page 1 "of" 3 of = "de" # E.g. Page 1 "of" 3
@ -43,8 +44,12 @@ go_to_comments = "Ir para a seção de comentários"
# Post metadata. # Post metadata.
draft = "RASCUNHO" draft = "RASCUNHO"
min_read = "min de leitura" zero_min_read = "<1 min de leitura"
words = "palavras" one_min_read = "$NUMBER min de leitura"
many_min_read = "$NUMBER mins de leitura"
zero_words = "Nenhuma palavra"
one_words = "$NUMBER palavra"
many_words = "$NUMBER palavras"
last_updated_on = "Última atualização em" last_updated_on = "Última atualização em"
see_changes = "Ver alterações" see_changes = "Ver alterações"

@ -2,6 +2,10 @@ language_name = "Русский" # Shown in language picker for multi-language
date_locale = "ru_RU" date_locale = "ru_RU"
full-stop = "." # Used at the end of a sentence. full-stop = "." # Used at the end of a sentence.
# Note on pluralization prefixes:
# - few_: for numbers ending in 2-4, except 12-14, in genitive singular.
# - many_: for all others, including 5-9, 0, and teens (11-14), in genitive plural.
# Menu items. # Menu items.
# Should match the names in config.extra.menu and config.extra.footer_menu. # Should match the names in config.extra.menu and config.extra.footer_menu.
blog = "блог" blog = "блог"
@ -18,13 +22,17 @@ sitemap = "карта сайта"
search = "Поиск" search = "Поиск"
search_icon_title = "Нажмите или используйте $SHORTCUT для открытия поиска" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "Нажмите или используйте $SHORTCUT для открытия поиска" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "Очистить поиск" # Title of the X icon next to search input. clear_search = "Очистить поиск" # Title of the X icon next to search input.
result = "результат" # "1 result" zero_results = "Нет результатов"
results = "результаты" # "3 results" (also used for 0 results). one_results = "$NUMBER результат"
few_results = "$NUMBER результата" # 2, 3, 4 but not 12-14
many_results = "$NUMBER результатов" # 5-9, 0, 11-14, and others
# Navigation. # Navigation.
read_more = "Читать далее" read_more = "Читать далее"
post = "пост" post = "пост"
posts = "посты" # Plural of "post". one_posts = "$NUMBER пост"
few_posts = "$NUMBER поста" # 2, 3, 4 but not 12-14
many_posts = "$NUMBER постов" # 5-9, 0, 11-14, and others
prev = "Пред." # As in "Previous" page. prev = "Пред." # As in "Previous" page.
next = "След." # As in "Next" page. next = "След." # As in "Next" page.
of = "из" # E.g. Page 1 "of" 3 of = "из" # E.g. Page 1 "of" 3
@ -43,8 +51,14 @@ go_to_comments = "Перейти к комментариям"
# Post metadata. # Post metadata.
draft = "ЧЕРНОВИК" draft = "ЧЕРНОВИК"
min_read = "мин чтения" zero_min_read = "<1 мин чтения"
words = "слова" one_min_read = "$NUMBER мин чтения"
few_min_read = "$NUMBER мин чтения" # 2, 3, 4 but not 12-14
many_min_read = "$NUMBER мин чтения" # 5-9, 0, 11-14, and others
zero_words = "Нет слов"
one_words = "$NUMBER слово"
few_words = "$NUMBER слова" # 2, 3, 4 but not 12-14
many_words = "$NUMBER слов" # 5-9, 0, 11-14, and others
last_updated_on = "Последнее обновление" last_updated_on = "Последнее обновление"
see_changes = "Смотреть изменения" see_changes = "Смотреть изменения"

@ -2,6 +2,11 @@
# If you would like to help correct errors or improve the translation, # If you would like to help correct errors or improve the translation,
# please open an issue or submit a pull request. # please open an issue or submit a pull request.
# https://github.com/welpo/tabi # https://github.com/welpo/tabi
# Note on pluralization prefixes:
# - few_: for numbers ending in 2-4, except 12-14, in genitive singular.
# - many_: for all others, including 5-9, 0, and teens (11-14), in genitive plural.
language_name = "Українська" # Shown in language picker for multi-language sites. language_name = "Українська" # Shown in language picker for multi-language sites.
date_locale = "uk_UA" date_locale = "uk_UA"
full-stop = "." # Used at the end of a sentence. full-stop = "." # Used at the end of a sentence.
@ -22,13 +27,16 @@ sitemap = "карта сайту"
search = "Пошук" search = "Пошук"
search_icon_title = "Натисніть або використовуйте $SHORTCUT, щоб відкрити пошук" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "Натисніть або використовуйте $SHORTCUT, щоб відкрити пошук" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "Очистити пошук" # Title of the X icon next to search input. clear_search = "Очистити пошук" # Title of the X icon next to search input.
result = "результат" # "1 result" zero_results = "Немає результатів"
results = "результати" # "3 results" (also used for 0 results). one_results = "$NUMBER результат"
few_results = "$NUMBER результати"
many_results = "$NUMBER результатів"
# Navigation. # Navigation.
read_more = "Читати далі" read_more = "Читати далі"
post = "пост" one_posts = "$NUMBER пост"
posts = "пости" # Plural of "post". few_posts = "$NUMBER пости" # 2, 3, 4 but not 12-14
many_posts = "$NUMBER постів" # 5-9, 0, 11-14, and others
prev = "Попер." # As in "Previous" page. prev = "Попер." # As in "Previous" page.
next = "Наст." # As in "Next" page. next = "Наст." # As in "Next" page.
of = "з" # E.g. Page 1 "of" 3 of = "з" # E.g. Page 1 "of" 3
@ -47,8 +55,14 @@ go_to_comments = "Перейти до коментарів"
# Post metadata. # Post metadata.
draft = "ЧЕРНЕТКА" draft = "ЧЕРНЕТКА"
min_read = "хв. читання" zero_min_read = "<1 хв. читання"
words = "слова" one_min_read = "$NUMBER хв. читання"
few_min_read = "$NUMBER хв. читання" # 2, 3, 4 but not 12-14
many_min_read = "$NUMBER хв. читання" # 5-9, 0, 11-14, and others
zero_words = "Без слів"
one_words = "$NUMBER слово"
few_words = "$NUMBER слова" # 2, 3, 4 but not 12-14
many_words = "$NUMBER слів" # 5-9, 0, 11-14, and others
last_updated_on = "Останнє оновлення" last_updated_on = "Останнє оновлення"
see_changes = "Переглянути зміни" see_changes = "Переглянути зміни"

@ -18,13 +18,14 @@ sitemap = "站点地图" # Machine translated.
search = "搜索" search = "搜索"
search_icon_title = "点击或按 $SHORTCUT 开启搜索" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "点击或按 $SHORTCUT 开启搜索" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "清除搜索" # Title of the X icon next to search input. clear_search = "清除搜索" # Title of the X icon next to search input.
result = "结果" # "1 result" zero_results = "没有找到结果"
results = "结果" # "3 results" (also used for 0 results). one_results = "$NUMBER 个结果"
many_results = "$NUMBER 个结果"
# Navigation. # Navigation.
read_more = "阅读全文" read_more = "阅读全文"
post = "文章" one_posts = "$NUMBER 篇文章"
posts = "文章" # Plural of "post". many_posts = "$NUMBER 篇文章"
prev = "上一页" # As in "Previous" page. prev = "上一页" # As in "Previous" page.
next = "下一页" # As in "Next" page. next = "下一页" # As in "Next" page.
of = "/" # E.g. Page 1 "of" 3 of = "/" # E.g. Page 1 "of" 3
@ -36,7 +37,6 @@ dark = "暗" # Machine translated.
light = "亮" # Machine translated. light = "亮" # Machine translated.
reset_mode = "将模式重置为网站默认值" # Machine translated. reset_mode = "将模式重置为网站默认值" # Machine translated.
# Quick navigation buttons. # Quick navigation buttons.
toggle_toc = "切换目录" # Machine translated. toggle_toc = "切换目录" # Machine translated.
go_to_top = "返回页面顶部" # Machine translated. go_to_top = "返回页面顶部" # Machine translated.
@ -44,8 +44,12 @@ go_to_comments = "转到评论区" # Machine translated.
# Post metadata. # Post metadata.
draft = "草稿" draft = "草稿"
min_read = "分钟阅读" zero_min_read = "少于1分钟阅读"
words = "字" one_min_read = "$NUMBER 分钟阅读"
many_min_read = "$NUMBER 分钟阅读"
zero_words = "没有字"
one_words = "$NUMBER 字"
many_words = "$NUMBER 字"
last_updated_on = "最后更新于" last_updated_on = "最后更新于"
see_changes = "修改纪录" see_changes = "修改纪录"

@ -18,13 +18,14 @@ sitemap = "網站地圖" # Machine translated.
search = "搜尋" search = "搜尋"
search_icon_title = "點擊或按 $SHORTCUT 來開啟搜尋" # $SHORTCUT will be replaced with the actual keyboard shortcut. search_icon_title = "點擊或按 $SHORTCUT 來開啟搜尋" # $SHORTCUT will be replaced with the actual keyboard shortcut.
clear_search = "清除搜尋" # Title of the X icon next to search input. clear_search = "清除搜尋" # Title of the X icon next to search input.
result = "結果" # "1 result" zero_results = "沒有找到結果"
results = "結果" # "3 results" (also used for 0 results). one_results = "$NUMBER 個結果"
many_results = "$NUMBER 個結果"
# Navigation. # Navigation.
read_more = "閱讀全文" read_more = "閱讀全文"
post = "文章" one_posts = "$NUMBER 篇文章"
posts = "文章" # Plural of "post". many_posts = "$NUMBER 篇文章"
prev = "上一頁" # As in "Previous" page. prev = "上一頁" # As in "Previous" page.
next = "下一頁" # As in "Next" page. next = "下一頁" # As in "Next" page.
of = "/" # E.g. Page 1 "of" 3 of = "/" # E.g. Page 1 "of" 3
@ -43,8 +44,12 @@ go_to_comments = "轉到評論區" # Machine translated.
# Post metadata. # Post metadata.
draft = "草稿" draft = "草稿"
min_read = "分鐘閱讀" zero_min_read = "少於1分鐘閱讀"
words = "字" one_min_read = "$NUMBER 分鐘閱讀"
many_min_read = "$NUMBER 分鐘閱讀"
zero_words = "沒有字"
one_words = "$NUMBER 字"
many_words = "$NUMBER 字"
last_updated_on = "最後更新於" last_updated_on = "最後更新於"
see_changes = "修改紀錄" see_changes = "修改紀錄"

@ -2575,13 +2575,28 @@ window.onload = function () {
return; return;
} }
const results = document.getElementById('results'); const lang = document.documentElement.lang;
const searchInput = document.getElementById('searchInput'); const searchInput = document.getElementById('searchInput');
const searchModal = document.getElementById('searchModal'); const searchModal = document.getElementById('searchModal');
const searchButton = document.getElementById('search-button'); const searchButton = document.getElementById('search-button');
const nResultsSpan = document.getElementById('n-results');
const clearSearchButton = document.getElementById('clear-search'); const clearSearchButton = document.getElementById('clear-search');
const resultsContainer = document.getElementById('results-container'); const resultsContainer = document.getElementById('results-container');
const results = document.getElementById('results');
// Get all spans holding the translated strings, even if they are only used on one language.
const zeroResultsSpan = document.getElementById('zero_results');
const oneResultsSpan = document.getElementById('one_results');
const twoResultsSpan = document.getElementById('two_results');
const fewResultsSpan = document.getElementById('few_results');
const manyResultsSpan = document.getElementById('many_results');
// Static mapping of keys to spans.
const resultSpans = {
zero_results: zeroResultsSpan,
one_results: oneResultsSpan,
two_results: twoResultsSpan,
few_results: fewResultsSpan,
many_results: manyResultsSpan,
};
// Replace $SHORTCUT in search icon title with actual OS-specific shortcut. // Replace $SHORTCUT in search icon title with actual OS-specific shortcut.
function getShortcut() { function getShortcut() {
@ -2658,7 +2673,6 @@ window.onload = function () {
function clearSearch() { function clearSearch() {
searchInput.value = ''; searchInput.value = '';
results.innerHTML = ''; results.innerHTML = '';
nResultsSpan.textContent = '0';
resultsContainer.style.display = 'none'; resultsContainer.style.display = 'none';
searchInput.removeAttribute('aria-activedescendant'); searchInput.removeAttribute('aria-activedescendant');
} }
@ -3006,19 +3020,66 @@ window.onload = function () {
); );
function updateResultText(count) { function updateResultText(count) {
const nResultsSpan = document.getElementById('n-results'); // Determine the correct pluralization key based on count and language.
nResultsSpan.textContent = count.toString(); const pluralizationKey = getPluralizationKey(count, lang);
// Hide all result text spans.
Object.values(resultSpans).forEach((span) => {
if (span) span.style.display = 'none';
});
// Show the relevant result text span, replacing $NUMBER with the actual count.
const activeSpan = resultSpans[pluralizationKey];
if (activeSpan) {
activeSpan.style.display = 'inline';
activeSpan.textContent = activeSpan.textContent.replace(
'$NUMBER',
count.toString()
);
}
}
const singular = document.getElementById('result-text-singular'); function getPluralizationKey(count, lang) {
const plural = document.getElementById('result-text-plural'); let key = '';
const slavicLangs = ['uk', 'be', 'bs', 'hr', 'ru', 'sr'];
if (count === 1) { // Common cases: zero, one.
singular.style.display = 'inline'; if (count === 0) {
plural.style.display = 'none'; key = 'zero_results';
} else if (count === 1) {
key = 'one_results';
} else {
// Arabic.
if (lang === 'ar') {
let modulo = count % 100;
if (count === 2) {
key = 'two_results';
} else if (modulo >= 3 && modulo <= 10) {
key = 'few_results';
} else {
key = 'many_results';
}
} else if (slavicLangs.includes(lang)) {
// Slavic languages.
let modulo10 = count % 10;
let modulo100 = count % 100;
if (modulo10 === 1 && modulo100 !== 11) {
key = 'one_results';
} else if (
modulo10 >= 2 &&
modulo10 <= 4 &&
!(modulo100 >= 12 && modulo100 <= 14)
) {
key = 'few_results';
} else { } else {
singular.style.display = 'none'; key = 'many_results';
plural.style.display = 'inline';
} }
} else {
key = 'many_results'; // Default plural.
}
}
return key;
} }
function setupTouchEvents() { function setupTouchEvents() {

File diff suppressed because one or more lines are too long

@ -1,3 +1,72 @@
{% macro translate(key, language_strings="", default="") %} {#- Dynamically selects the appropriate translation key based on the provided `number` and `lang` context.
{{- language_strings[key] | default(value=default) | safe -}} If a `number` is provided, the macro will attempt to pluralize the translation key based on the language's rules.
Parameters:
- `key`: The base key for the translation string, matching the i18n files. Example: `results` to get `zero_results`, `one_results`, `many_results`, etc.
- `number`: Optional. The numerical value associated with the key.
- `language_strings`: A dictionary containing the translation strings.
- `default`: A default string to use if no translation is found for the key.
- `replace`: Optional. If `true`, the macro will replace the `$NUMBER` placeholder in the translation string with the provided `number`.
The macro supports special pluralization rules for:
- Arabic (`ar`): Has unique forms for zero, one, two, few, and many.
- Slavic languages: Pluralization depends on the last digit of the number, with exceptions for numbers ending in 11-14.
NOTE: If the logic for pluralization is modified, it needs to be replicated on the JavaScript search.
Files: static/js/searchElasticlunr.js and its minified version at static/js/searchElasticlunr.min.js
Function name: getPluralizationKey -#}
{% macro translate(key, number=-1, language_strings="", default="", replace=true) %}
{%- set slavic_plural_languages = ["uk", "be", "bs", "hr", "ru", "sr"] -%}
{%- set key_prefix = "" -%}
{#- `zero_` and `one_` are common cases. We handle "many" (plural) later, after language-specific pluralization -#}
{%- if number == 0 -%}
{%- set key_prefix = "zero_" -%}
{%- elif number == 1 -%}
{%- set key_prefix = "one_" -%}
{%- endif -%}
{#- Pluralization -#}
{%- if number != -1 and key_prefix == "" -%}
{#- Arabic -#}
{%- if lang == "ar" -%}
{%- set modulo = number % 100 -%}
{%- if number == 2 -%}
{%- set key_prefix = "two_" -%}
{%- elif modulo >= 3 and modulo <= 10 -%}
{%- set key_prefix = "few_" -%}
{%- else -%}
{%- set key_prefix = "many_" -%}
{%- endif -%}
{#- Slavic languages like Russian or Ukrainian -#}
{%- elif lang in slavic_plural_languages -%}
{%- set modulo10 = number % 10 -%}
{%- set modulo100 = number % 100 -%}
{%- if modulo10 == 1 and modulo100 != 11 -%}
{%- set key_prefix = "one_" -%}
{%- elif modulo10 >= 2 and modulo10 <= 4 -%}
{%- if modulo100 >= 12 and modulo100 <= 14 -%}
{%- set key_prefix = "many_" -%}
{%- else -%}
{%- set key_prefix = "few_" -%}
{%- endif -%}
{%- else -%}
{%- set key_prefix = "many_" -%}
{%- endif -%}
{%- else -%}
{#- Default pluralization -#}
{#- Zero and one are already handled -#}
{%- set key_prefix = "many_" -%}
{%- endif -%}
{%- endif -%}
{#- Translated string -#}
{%- set final_key = key_prefix ~ key -%}
{%- set translated_text = language_strings[final_key] | default(value=default) | safe -%}
{#- Replace $NUMBER with the number -#}
{%- if replace -%}
{%- set translated_text = translated_text | replace(from="$NUMBER", to=number | as_str) -%}
{%- endif -%}
{{- translated_text -}}
{% endmacro %} {% endmacro %}

@ -69,7 +69,7 @@
{# page settings override config settings #} {# page settings override config settings #}
{% if macros_settings::evaluate_setting_priority(setting="show_reading_time", page=page, default_global_value=true) == "true" %} {% if macros_settings::evaluate_setting_priority(setting="show_reading_time", page=page, default_global_value=true) == "true" %}
{{ separator }} <li title="{{ page.word_count }} {{ macros_translate::translate(key="words", default="words", language_strings=language_strings) }}">{{ page.reading_time }}&nbsp;{{ macros_translate::translate(key="min_read", default="min read", language_strings=language_strings) }}</li> {{ separator }} <li title="{{ macros_translate::translate(key="words", number=page.word_count, default="$NUMBER words", language_strings=language_strings) }}">{{ macros_translate::translate(key="min_read", number=page.reading_time, default="$NUMBER min read", language_strings=language_strings) }}</li>
{% endif %} {% endif %}
{%- if page.taxonomies and page.taxonomies.tags -%} {%- if page.taxonomies and page.taxonomies.tags -%}

@ -16,8 +16,14 @@
</div> </div>
<div id="results-container"> <div id="results-container">
<div id="results-info"> <div id="results-info">
<span id="n-results">0</span>&nbsp;<span id="result-text-singular">{{ macros_translate::translate(key='result', default='result', language_strings=language_strings) }}</span> {#- Add the strings here so JavaScript can grab them -#}
<span id="result-text-plural">{{ macros_translate::translate(key='results', default='results', language_strings=language_strings) }}</span> {#- These are used in all languages -#}
<span id="zero_results"> {{ macros_translate::translate(key='results', number=0, default='No results', language_strings=language_strings, replace=false) }}</span>
<span id="one_results"> {{ macros_translate::translate(key='results', number=1, default='1 result', language_strings=language_strings, replace=false) }}</span>
<span id="many_results"> {{ macros_translate::translate(key='results', number=11, default='$NUMBER results', language_strings=language_strings, replace=false) }}</span>
{#- Strings for specific languages -#}
<span id="two_results"> {{ macros_translate::translate(key='results', number=2, default='$NUMBER results', language_strings=language_strings, replace=false) }}</span>
<span id="few_results"> {{ macros_translate::translate(key='results', number=2, default='$NUMBER results', language_strings=language_strings, replace=false) }}</span>
</div> </div>
<div id="results" role="listbox"></div> <div id="results" role="listbox"></div>
</div> </div>

@ -11,28 +11,21 @@
<ul class="tags"> <ul class="tags">
{%- for term in terms -%} {%- for term in terms -%}
<li class="tags-item"> <li class="tags-item">
{%- set number_of_posts = term.pages | length -%}
{% if config.extra.compact_tags %} {% if config.extra.compact_tags %}
{# Shows the number of posts per tag as a superscript #} {# Shows the number of posts per tag as a superscript #}
<a href="{{ term.permalink | safe }}" <a href="{{ term.permalink | safe }}"
aria-label="{{ term.name }} aria-label="{{ term.name }}
{{ term.pages | length }} {{ term.pages | length }}
{% if term.pages | length == 1 -%} {{- macros_translate::translate(key="posts", number=number_of_posts, default="$NUMBER posts", language_strings=language_strings) -}}
{{- macros_translate::translate(key="post", default="post", language_strings=language_strings) -}} ">
{%- else -%}
{{- macros_translate::translate(key="posts", default="posts", language_strings=language_strings) -}}
{%- endif -%}">
{{ term.name }} {{ term.name }}
</a> <sup>{{ term.pages | length }}</sup> </a> <sup>{{ number_of_posts }}</sup>
{% else %} {% else %}
<a href="{{ term.permalink | safe }}"> <a href="{{ term.permalink | safe }}">
{{ term.name }}</a> {{ term.name }} </a>
{{ term.pages | length }}{%- if term.pages | length == 1 %} <span> </span>
{# Only one post. Singular. #} {{- macros_translate::translate(key="posts", number=number_of_posts, default="$NUMBER posts", language_strings=language_strings) -}}
{{- macros_translate::translate(key="post", default="post", language_strings=language_strings) -}}
{% elif term.pages | length > 1 %}
{# More than one post per tag. Plural. #}
{{- macros_translate::translate(key="posts", default="posts", language_strings=language_strings) -}}
{%- endif -%}
{% endif %} {% endif %}
</li> </li>
{%- endfor -%} {%- endfor -%}

@ -11,28 +11,21 @@
<ul class="tags"> <ul class="tags">
{%- for term in terms -%} {%- for term in terms -%}
<li class="tags-item"> <li class="tags-item">
{%- set number_of_posts = term.pages | length -%}
{% if config.extra.compact_tags %} {% if config.extra.compact_tags %}
{# Shows the number of posts per tag as a superscript #} {# Shows the number of posts per tag as a superscript #}
<a href="{{ term.permalink | safe }}" <a href="{{ term.permalink | safe }}"
aria-label="{{ term.name }} aria-label="{{ term.name }}
{{ term.pages | length }} {{ term.pages | length }}
{% if term.pages | length == 1 -%} {{- macros_translate::translate(key="posts", number=number_of_posts, default="$NUMBER posts", language_strings=language_strings) -}}
{{- macros_translate::translate(key="post", default="post", language_strings=language_strings) -}} ">
{%- else -%}
{{- macros_translate::translate(key="posts", default="posts", language_strings=language_strings) -}}
{%- endif -%}">
{{ term.name }} {{ term.name }}
</a> <sup>{{ term.pages | length }}</sup> </a> <sup>{{ number_of_posts }}</sup>
{% else %} {% else %}
<a href="{{ term.permalink | safe }}"> <a href="{{ term.permalink | safe }}">
{{ term.name }}</a> {{ term.name }} </a>
{{ term.pages | length }}{%- if term.pages | length == 1 %} <span> </span>
{# Only one post. Singular. #} {{- macros_translate::translate(key="posts", number=number_of_posts, default="$NUMBER posts", language_strings=language_strings) -}}
{{- macros_translate::translate(key="post", default="post", language_strings=language_strings) -}}
{% elif term.pages | length > 1 %}
{# More than one post per tag. Plural. #}
{{- macros_translate::translate(key="posts", default="posts", language_strings=language_strings) -}}
{%- endif -%}
{% endif %} {% endif %}
</li> </li>
{%- endfor -%} {%- endfor -%}

Loading…
Cancel
Save