From d3b0af91aa342a889eaa746c930eb0c53a357169 Mon Sep 17 00:00:00 2001 From: Gudule Lapointe Date: Thu, 3 Aug 2023 08:15:56 -0400 Subject: [PATCH] * added bases for localization --- .gpt-po/dictionary.json | 4 ++ .gpt-po/systemprompt.txt | 1 + guide.php | 23 ++++++------ includes/functions.php | 43 +++++++++++++++++++++ locales/cy_GB/LC_MESSAGES/messages.mo | Bin 0 -> 1102 bytes locales/cy_GB/LC_MESSAGES/messages.po | 52 ++++++++++++++++++++++++++ locales/de_DE/LC_MESSAGES/messages.mo | Bin 0 -> 1135 bytes locales/de_DE/LC_MESSAGES/messages.po | 52 ++++++++++++++++++++++++++ locales/fr_FR/LC_MESSAGES/messages.mo | Bin 0 -> 1141 bytes locales/fr_FR/LC_MESSAGES/messages.po | 52 ++++++++++++++++++++++++++ locales/it_IT/LC_MESSAGES/messages.mo | Bin 0 -> 671 bytes locales/it_IT/LC_MESSAGES/messages.po | 52 ++++++++++++++++++++++++++ locales/messages.pot | 52 ++++++++++++++++++++++++++ locales/pt_BR/LC_MESSAGES/messages.mo | Bin 0 -> 1116 bytes locales/pt_BR/LC_MESSAGES/messages.po | 52 ++++++++++++++++++++++++++ locales/update_translations.sh | 16 ++++++++ 16 files changed, 388 insertions(+), 11 deletions(-) create mode 100644 .gpt-po/dictionary.json create mode 100644 .gpt-po/systemprompt.txt create mode 100644 locales/cy_GB/LC_MESSAGES/messages.mo create mode 100644 locales/cy_GB/LC_MESSAGES/messages.po create mode 100644 locales/de_DE/LC_MESSAGES/messages.mo create mode 100644 locales/de_DE/LC_MESSAGES/messages.po create mode 100644 locales/fr_FR/LC_MESSAGES/messages.mo create mode 100644 locales/fr_FR/LC_MESSAGES/messages.po create mode 100644 locales/it_IT/LC_MESSAGES/messages.mo create mode 100644 locales/it_IT/LC_MESSAGES/messages.po create mode 100644 locales/messages.pot create mode 100644 locales/pt_BR/LC_MESSAGES/messages.mo create mode 100644 locales/pt_BR/LC_MESSAGES/messages.po create mode 100755 locales/update_translations.sh diff --git a/.gpt-po/dictionary.json b/.gpt-po/dictionary.json new file mode 100644 index 0000000..492fbb7 --- /dev/null +++ b/.gpt-po/dictionary.json @@ -0,0 +1,4 @@ +{ + "Speculoos World" : "a virtual world grid name", + "helper" : "a web application complementing OpenSimulator features, must be treated as a software application, not a human assistant." +} diff --git a/.gpt-po/systemprompt.txt b/.gpt-po/systemprompt.txt new file mode 100644 index 0000000..9b0e7ed --- /dev/null +++ b/.gpt-po/systemprompt.txt @@ -0,0 +1 @@ +You are an awesome translator! Please translate the following text in a casual and approachable style, suitable for a friendly WordPress plugin interface. Avoid overly formal language and aim for a more relaxed and user-friendly tone, and sounding like a machine translation. All inputs are phrases to translate. "Yes" or "No" are not remarks to you, they are the actual strings to translate. Original language is English, the response should never be in English but in the target language. Remember to always translate the text, never interpret it, and never explain it. The project is a PHP library for use in OpenSimulator virtual world environment. diff --git a/guide.php b/guide.php index c528764..8e2fe50 100644 --- a/guide.php +++ b/guide.php @@ -26,7 +26,7 @@ class OpenSim_Guide { private $source; public function __construct() { - error_log( 'language ' . getPreferredLanguage() ); + set_helpers_locale(); $this->url_base = $this->getFullURL(); @@ -85,7 +85,7 @@ class OpenSim_Guide { $lines = explode( "\n", $fileContent ); - $categoryTitle = 'Destinations list'; + $categoryTitle = _('Destinations Guide'); foreach ( $lines as $line ) { // Exclude lines starting with "#" or "//" or containing no actual characters if ( substr( trim( $line ), 0, 1 ) === '#' || substr( trim( $line ), 0, 2 ) === '//' || ! trim( $line ) ) { @@ -125,8 +125,8 @@ class OpenSim_Guide { public function categories_list() { $content = '
' - . '

Destinations List

' - . 'This is a work in progress, please be indulgent.' + . '

' . _('Destinations Guide') . '

' + . '' . _('This is a work in progress, please be indulgent.') . '' . '
' . '
'; foreach ( $this->destinations as $categoryTitle => $destinations ) { @@ -135,7 +135,8 @@ class OpenSim_Guide { . '
' . '' . $categoryTitle . '' . '
' . $categoryTitle . '
' - . '
' . count( $destinations ) . ' destinations
' + # Translators: %s will be replaced with the number of destinations + . '
' . sprintf( _('%s destinations'), count( $destinations ) ) . '
' . '
' . ''; } @@ -148,9 +149,9 @@ class OpenSim_Guide { // Build header $content = '

' . $categoryTitle . '

'; if ( count( $this->destinations ) > 1 ) { - $content .= 'Back to categories'; + $content .= '' . _('Back to categories') . ''; } - $content .= 'This is a work in progress, please be indulgent.'; + $content .= '' . _('This is a work in progress, please be indulgent.') . ''; $content .= '
'; // Build list @@ -164,11 +165,11 @@ class OpenSim_Guide { . '
' . $destination['name'] . '
' . '
'; if ( $people > 0 ) { - $content .= ' ' . $this->place_people() . ' people '; + $content .= ' ' . sprintf( _('%s people'), $this->place_people() ) . ' '; } if ( $traffic > 0 ) { - $content .= ' Traffic: ' . $this->place_traffic() . ' '; - } + $content .= ' ' . sprintf( _('traffic %s'), $this->place_traffic() ) . ' '; + } $content .= '
'; } $content .= ''; @@ -178,7 +179,7 @@ class OpenSim_Guide { private function no_result() { echo '
'; - echo 'The realm of destinations you seek has eluded our grasp, spirited away by elusive knomes. Rally the grid managers, let them venture forth to curate a grand tapestry of remarkable places for your exploration!'; + echo _('The realm of destinations you seek has eluded our grasp, spirited away by elusive knomes. Rally the grid managers, let them venture forth to curate a grand tapestry of remarkable places for your exploration!'); echo '
'; echo $this->getFullURL() . "?source=$this->source"; } diff --git a/includes/functions.php b/includes/functions.php index 1743087..326e08b 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -410,6 +410,48 @@ if ( ! function_exists( 'osdebug' ) ) { } } +function set_helpers_locale( $locale = null, $domain = 'messages' ) { + mb_internal_encoding('UTF-8'); + $encoding = mb_internal_encoding(); + + if (isset($_GET["l"])) $locale = $_GET["l"]; + $languages = array_filter(array_merge( array($locale), explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) )); + + // $results = putenv("LC_ALL=$locale"); + // if (!$results) { + // exit ('putenv failed'); + // } + + // $currentLocale = setlocale(LC_ALL, 0); + $user_locales = array_unique(array( $locale, $locale . ".$encoding", $locale . '.UTF-8', $locale . '.utf8', $locale, 0 )); + + $user_locales = array_map(function ($code) { + return preg_replace( + array('/;.*/', '/-/' ), + array ('', '_'), + $code + ); + }, $languages); + + // Generate variants with different encodings appended + $variants = array(); + foreach ($user_locales as $lang) { + $variants[] = $lang; + $variants[] = "$lang.$encoding"; + // $variants[] = "$lang.UTF-8"; + } + + $variants = array_unique($variants); + if ( ! setlocale(LC_ALL, $variants ) ) { + error_log ("setlocale() failed: none of '" . join(', ', $variants) . "' does exist in this environment or setlocale() is not available on this platform"); + setlocale(LC_ALL, 0 ); + return 0; + } + + bindtextdomain($domain, "./locales"); + textdomain($domain); +} + define( 'NULL_KEY', '00000000-0000-0000-0000-000000000000' ); define( 'TPLINK_LOCAL', 1 ); // seconlife://Region/x/y/z define( 'TPLINK_HG', 2 ); // seconlife://yourgrid.org:8002 Region/x/y/z @@ -421,6 +463,7 @@ define( 'TPLINK_MAP', 64 ); // secondlife:///app/map/yourgrid.org:8002:Region/x/ define( 'TPLINK', pow( 2, 8 ) - 1 ); // all formats define( 'TPLINK_DEFAULT', TPLINK_HOP ); // default +define( 'HELPERS_LOCALE_DIR', dirname( __DIR__ ) . '/languages' ); /** * OpenSim source to help further attempts to allow Hypergrid search results. diff --git a/locales/cy_GB/LC_MESSAGES/messages.mo b/locales/cy_GB/LC_MESSAGES/messages.mo new file mode 100644 index 0000000000000000000000000000000000000000..ecca178b873e68de7d8dcb39262164e31af9608f GIT binary patch literal 1102 zcmY*XO^X#d6pf=Z>Jyy7kKG8@g}CW@W77+z#f{z4G>l9mjVK6mU*%RRzPzMJQeEbU zxbr`_@gKMuSFS~HGrwRqv!0V`!I@BpQ+4a+-gA@l^~$+73hM&!EARri1iS_6`V;sW z_y}ACJ_A>PzrOK5;7`ECGfLe7e+DnWiyxHw0=^Eu4E`H@9<0tPbq#a@d=-2H{1vK8xfueT zY%lLD@8Y*NBW7)mg*S8h>Gv+R<>kS{#pA=rkG?m+p2c498Dg5_GN68z*ZDULY5jd_ zdyYx+gE4o_z3+LocPFuVHMEkPDL(H^<2~jq@+y7fe_H literal 0 HcmV?d00001 diff --git a/locales/cy_GB/LC_MESSAGES/messages.po b/locales/cy_GB/LC_MESSAGES/messages.po new file mode 100644 index 0000000..fcb285b --- /dev/null +++ b/locales/cy_GB/LC_MESSAGES/messages.po @@ -0,0 +1,52 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: gpt-po v1.0.7\n" +"Language-Team: \n" +"Language: cy_GB\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.0.1\n" + +#: guide.php:88 guide.php:128 +msgid "Destinations Guide" +msgstr "Canllaw Cyrchfannau" + +#: guide.php:129 guide.php:154 +msgid "This is a work in progress, please be indulgent." +msgstr "Gwaith ar y gweill yw hwn, cewch fod yn amyneddgar." + +#: guide.php:139 +#, php-format +msgid "%s destinations" +msgstr "%s cyfeiriadau" + +#: guide.php:152 +msgid "Back to categories" +msgstr "Yn ôl i gategorïau" + +#: guide.php:168 +#, php-format +msgid "%s people" +msgstr "%s pobl" + +#: guide.php:170 +#, php-format +msgid "traffic %s" +msgstr "llywio %s" + +#: guide.php:182 +msgid "" +"The realm of destinations you seek has eluded our grasp, spirited away by elusive knomes. Rally the grid managers, let " +"them venture forth to curate a grand tapestry of remarkable places for your exploration!" +msgstr "" +"I ddiffodd ein gafael ar y ddaear o gyrchfeydd a hoffech, clywir hwynt yn taro drwy 'nawdd y tylwyth teg. Ysgogi'r " +"rheolwyr grid, gadewch iddynt anterth i guradu tapistry mawr o leoliadau rhyfeddol ar gyfer eich archwilio!" diff --git a/locales/de_DE/LC_MESSAGES/messages.mo b/locales/de_DE/LC_MESSAGES/messages.mo new file mode 100644 index 0000000000000000000000000000000000000000..08c0ec1f0a8cfe7e5c2593f82b54991536f4bf70 GIT binary patch literal 1135 zcmY*XO=}cE5N*Grt_ML75j>PaZaZtlgCXJ}nh=79gcwwUAiXm+GwsZD57pfp*Z<*7 z@Q>t{i=I4-;Kh?iFCIMkdN&en_U)Ug?y7!O^S)g<`%Yn90B!&;flI)9AgzzUW#AKV z5%>aJ0lpveFYssJ;whz;z+b=v@ZhvkU%^+wsrFBBs{0#!9lUTxscT>Y{{Sz8SHZW= z&hrZ}O3hZvUjPtN=Yewo%FGth=4;VY!9EzPgK^d?y!Y(-meoU@HxwM@I&kI0uvcsU zoTQCt3RZhHldx_(a^-)OXzC()=7wtRiQ8CkK`shaqJ2Lk-y1OjF@2z?G@hm--b|Pp z>pJ!$+SP44rGWaCn1VWOb;aU`)N)ASjwWnF6sFQisAp26KrHEWhb<`R9)e|>qzQLg z8a-~A`c~)cQ&!R_#Bci6ArbxGL_fw8ewq%PG-NFG;woW}i!l}LnZ}H85!(vak5mv{ zmL{h~uXe<}<~(GZMfMCzQE!C?JKNbVPfU8t)}RidC)$T>4-$Q=gOe4i`jGXGCU-_l zqkGu4RYb4Z9_wy)eEz2x4A2ftyXAxY{KA0w!xM$iX>{sabW`8g{C`$kkpW BT!8=p literal 0 HcmV?d00001 diff --git a/locales/de_DE/LC_MESSAGES/messages.po b/locales/de_DE/LC_MESSAGES/messages.po new file mode 100644 index 0000000..c818c06 --- /dev/null +++ b/locales/de_DE/LC_MESSAGES/messages.po @@ -0,0 +1,52 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: gpt-po v1.0.7\n" +"Language-Team: \n" +"Language: de_DE\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.0.1\n" + +#: guide.php:88 guide.php:128 +msgid "Destinations Guide" +msgstr "Reiseführer für Ziele" + +#: guide.php:129 guide.php:153 +msgid "This is a work in progress, please be indulgent." +msgstr "Dies ist eine Arbeit in Bearbeitung, bitte seien Sie nachsichtig." + +#: guide.php:138 +#, php-format +msgid "%s destinations" +msgstr "%s Ziele" + +#: guide.php:151 +msgid "Back to categories" +msgstr "Zurück zu den Kategorien" + +#: guide.php:167 +#, php-format +msgid "%s people" +msgstr "%s Personen" + +#: guide.php:170 +#, php-format +msgid "traffic %s" +msgstr "Verkehr %s" + +#: guide.php:181 +msgid "" +"The realm of destinations you seek has eluded our grasp, spirited away by elusive knomes. Rally the grid managers, let " +"them venture forth to curate a grand tapestry of remarkable places for your exploration!" +msgstr "" +"Die Welt der Ziele, die du suchst, ist uns entwischt, von flüchtigen Gnomen fortgetragen. Rufe die Grid-Manager " +"zusammen, lass sie sich aufmachen, um eine großartige Vielfalt bemerkenswerter Orte für deine Erkundung zu kuratieren!" diff --git a/locales/fr_FR/LC_MESSAGES/messages.mo b/locales/fr_FR/LC_MESSAGES/messages.mo new file mode 100644 index 0000000000000000000000000000000000000000..2daf4ee8f7f39dce67abab9108b0293a8755f4f0 GIT binary patch literal 1141 zcmZWoyKWOf6x~30#2}C&K}B&>L=jTfB%&ZPP(Tu*NQsCn3sE4U@$U6{@a)WH9!~84 zprfGmcesIyIzpnMrJ2W4b#E8117~k+F+eQKKb3t&~9`=3l`)(h)v_PK+Ip)KpnhSaxWPTM>?_%Q()1D$u@} zcq@86nbE3Cj;#5>nNRog^bM4vUW*z>uhTXUW!$AZP=})f;e6VGM5lx|wnatd)5_3r zv$@fHf}eE}Fl*XjQP$zJeT#bb{i}B4aQ|@kya93=+eUkcNjswo^*x{ZM;KD-rk@Ea;bp|OZ$3|*V+IMj`4`g!gsB&{UdoJm4!, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: gpt-po v1.0.7\n" +"Language-Team: \n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.0.1\n" + +#: guide.php:88 guide.php:128 +msgid "Destinations Guide" +msgstr "Guide des destinations" + +#: guide.php:129 guide.php:153 locale.php:71 +msgid "This is a work in progress, please be indulgent." +msgstr "Ceci est un travail en cours, veuillez faire preuve d'indulgence." + +#: guide.php:138 +#, php-format +msgid "%s destinations" +msgstr "%s destinations" + +#: guide.php:151 locale.php:73 +msgid "Back to categories" +msgstr "Retour aux catégories" + +#: guide.php:167 +#, php-format +msgid "%s people" +msgstr "%s personnes" + +#: guide.php:170 +#, php-format +msgid "traffic %s" +msgstr "trafic %s" + +#: guide.php:181 +msgid "" +"The realm of destinations you seek has eluded our grasp, spirited away by elusive knomes. Rally the grid managers, let " +"them venture forth to curate a grand tapestry of remarkable places for your exploration!" +msgstr "" +"Le royaume des destinations que vous recherchez nous échappe, emporté par des lutins insaisissables. Rassemblez les " +"gestionnaires de la grille, laissez-les s'aventurer pour créer une grande fresque de lieux remarquables à explorer !" diff --git a/locales/it_IT/LC_MESSAGES/messages.mo b/locales/it_IT/LC_MESSAGES/messages.mo new file mode 100644 index 0000000000000000000000000000000000000000..09ddf4007fa42066db29304492bdb78c9dec94d6 GIT binary patch literal 671 zcmYk3zit#U5XMaiiLw-kh=L-;q)3C}BN0NJ4p9IXMJEyEKr4i3kh43xG1+)lw)gn+ z40MQh;1QsvqNYTm%sbHW`S!$Rv_E~CvB%^6{AY9Zi$bh}Es%rj;1fvk4cq|V!3OvV zHo>ojUO@N2Uyy-2SCskg6pLQBO+!l6}DZ5oOb3{eovUWqOR! zC_OVF>f9R_8WY8jsBWWfg=YJMy}<)4ySg(q>zvK`e0!gd$i_F5JUf~k9V`c+CwnR` z;xan_(Bk~a@8jLJG1fh#;?(%S@lh8mJzVZfvn%%cz!g$jSC43TVq^A7AF^ZLUur5` z+DP|sr~T}buOIOzw)fQsaj;ChGh~{Em)@%6romIB>f%BA#^)VO7y9v)I!BF}iI?PZ XAvg>cv!^N*nS!-TpZUMhlAQhrto5^_ literal 0 HcmV?d00001 diff --git a/locales/it_IT/LC_MESSAGES/messages.po b/locales/it_IT/LC_MESSAGES/messages.po new file mode 100644 index 0000000..99185bf --- /dev/null +++ b/locales/it_IT/LC_MESSAGES/messages.po @@ -0,0 +1,52 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: gpt-po v1.0.7\n" +"Language-Team: \n" +"Language: it_IT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.0.1\n" + +#: guide.php:88 guide.php:128 +msgid "Destinations Guide" +msgstr "Guida delle destinazioni" + +#: guide.php:129 guide.php:153 +msgid "This is a work in progress, please be indulgent." +msgstr "Questo è un lavoro in corso, per favore sii indulgente." + +#: guide.php:138 +#, php-format +msgid "%s destinations" +msgstr "%s destinazioni" + +#: guide.php:151 +msgid "Back to categories" +msgstr "Torna alle categorie" + +#: guide.php:167 +#, php-format +msgid "%s people" +msgstr "%s persone" + +#: guide.php:170 +#, php-format +msgid "traffic %s" +msgstr "traffico %s" + +#: guide.php:182 +msgid "" +"The realm of destinations you seek has eluded our grasp, spirited away by elusive knomes. Rally the grid managers, let " +"them venture forth to curate a grand tapestry of remarkable places for your exploration!" +msgstr "" +"Il regno delle destinazioni che cerchi ci sfugge, portato via da gnomi sfuggenti. Raduna i gestori della griglia, " +"lasciali avventurarsi per creare un magnifico mosaico di luoghi straordinari da esplorare!" diff --git a/locales/messages.pot b/locales/messages.pot new file mode 100644 index 0000000..168c169 --- /dev/null +++ b/locales/messages.pot @@ -0,0 +1,52 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-08-02 19:44-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: guide.php:88 guide.php:128 +msgid "Destinations Guide" +msgstr "" + +#: guide.php:129 guide.php:154 +msgid "This is a work in progress, please be indulgent." +msgstr "" + +#: guide.php:139 +#, php-format +msgid "%s destinations" +msgstr "" + +#: guide.php:152 +msgid "Back to categories" +msgstr "" + +#: guide.php:168 +#, php-format +msgid "%s people" +msgstr "" + +#: guide.php:171 +#, php-format +msgid "traffic %s" +msgstr "" + +#: guide.php:182 +msgid "" +"The realm of destinations you seek has eluded our grasp, spirited away by " +"elusive knomes. Rally the grid managers, let them venture forth to curate a " +"grand tapestry of remarkable places for your exploration!" +msgstr "" diff --git a/locales/pt_BR/LC_MESSAGES/messages.mo b/locales/pt_BR/LC_MESSAGES/messages.mo new file mode 100644 index 0000000000000000000000000000000000000000..b5590645527e4f2efb48742b04a44fb958f9f81e GIT binary patch literal 1116 zcmY*Y!D0(*{RD^jZ}2_v{Iw{$1AYMh4qgSX zgBRy!`F$`-O;^x%13)Oc30wzIX1cI#ww4{G;=I!AmC-K3b0wxKB--F)Ox{q!UUFlV zxM=gAOxmthD$!shWQB{8O!i+TnwXlL$e2d#NQyd@luT_Yx9qAFa+R{mBgRKOq2VN? zIMoP^wJF7QX`hQ?LLT*Vt5Paib1v4cP$52qOKL>>+6raH`q5NsZ6TI8^w24Jt{~V> zf;1~7+c6Idp{n3ST-X&fT9V_cFxZImFX24O5q?ZZ#*Rs8s;tSaI5ftsuoD^z!f9RP zXy1*zfCKc*?Ira~6NTr`r zGGgn*uh%|{pIqjJ-kI2VOD85(I`7ewq4J#<@wRBeRRmFeBdPNA2%6S9!51^1m~)Rf zXV^strtoa3V#^msK^Wd(gqb&-8j^B|Nl}H-<*v5Ezjb+T8kxGLJ!OQ0j-t*P(}y14o-_hyOwa0SsGa$yJ#F8arD)5+dF^{tB3NR` j#VE)n_>fDeF|ZF*XWSSI^UEP$nn;3++LH{QS+LO`ahO+H literal 0 HcmV?d00001 diff --git a/locales/pt_BR/LC_MESSAGES/messages.po b/locales/pt_BR/LC_MESSAGES/messages.po new file mode 100644 index 0000000..1632fd2 --- /dev/null +++ b/locales/pt_BR/LC_MESSAGES/messages.po @@ -0,0 +1,52 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: gpt-po v1.0.7\n" +"Language-Team: \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.0.1\n" + +#: guide.php:88 guide.php:128 +msgid "Destinations Guide" +msgstr "Guia de Destinos" + +#: guide.php:129 guide.php:153 +msgid "This is a work in progress, please be indulgent." +msgstr "Este é um trabalho em andamento, por favor, seja indulgente." + +#: guide.php:138 +#, php-format +msgid "%s destinations" +msgstr "%s destinos" + +#: guide.php:151 +msgid "Back to categories" +msgstr "Voltar para categorias" + +#: guide.php:167 +#, php-format +msgid "%s people" +msgstr "%s pessoas" + +#: guide.php:170 +#, php-format +msgid "traffic %s" +msgstr "tráfego %s" + +#: guide.php:182 +msgid "" +"The realm of destinations you seek has eluded our grasp, spirited away by elusive knomes. Rally the grid managers, let " +"them venture forth to curate a grand tapestry of remarkable places for your exploration!" +msgstr "" +"O reino de destinos que você procura escapou de nosso alcance, levado embora por gnomos elusivos. Reúna os gerentes da " +"grid, deixe-os se aventurar para criar uma grande tapeçaria de lugares notáveis para sua exploração!" diff --git a/locales/update_translations.sh b/locales/update_translations.sh new file mode 100755 index 0000000..b2f01df --- /dev/null +++ b/locales/update_translations.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +find * -iname "*.php" | egrep -v -e vendor -e node_modules | xargs -d"\n" xgettext --from-code=UTF-8 -o locales/messages.pot + +pot=locales/messages.pot + +for lang in fr_FR de_DE cy_GB it_IT pt_BR +do + file="locales/$lang/LC_MESSAGES/messages.po" + + mkdir -p "$(dirname "$file")" && touch $file \ + && gpt-po sync --po "$file" --pot "$pot" \ + && gpt-po translate --po "$file" -l $lang \ + && poedit "$file" + +done