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

Translations for country and cache types #32

Closed
harrieklomp opened this issue Apr 6, 2018 · 12 comments
Closed

Translations for country and cache types #32

harrieklomp opened this issue Apr 6, 2018 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@harrieklomp
Copy link
Contributor

Could it be possible to add translations for countries and cache types?
selectie_156

@kumy kumy added the bug Something isn't working label Apr 6, 2018
@kumy
Copy link
Member

kumy commented Apr 6, 2018

Hum, nice catch. Those comes directly from the database. The database is synchronized from different opencaching sites. First step would be to synchronize those with English terms instead of "native opencaching site language"? Then we can think of a way to translate. It'll not be that easy. @harrieklomp please don't be frustrated if we don't fix this using the current website. @harrieklomp, @boly38 If you agree, I would close it as "Won't do - in current site version".

@boly38
Copy link
Member

boly38 commented Apr 6, 2018

We could maybe add a fieldset label 'opencaching results' (adapt wording) to mark the frontier between geokrety and external data.
and then consider this fieldset out of Geokrety responsibility: do not translate the content.

img_20180406_215057

(sorry I close by error)

@boly38 boly38 closed this as completed Apr 6, 2018
@boly38 boly38 reopened this Apr 6, 2018
@kumy
Copy link
Member

kumy commented Apr 6, 2018

@boly38 would you open a pull request / post a picture of the result?

@boly38
Copy link
Member

boly38 commented Apr 6, 2018

yep (next week) 🙃

@boly38
Copy link
Member

boly38 commented Apr 20, 2018

My personal draft / note:

  • import waypoint oc

todo list before PR:

  • add country translations
  • add cache type translations
  • fix crlf in sql
  • fix template html element
  • add note in contrib md about scrpts and php_cs and translation mechanism
  • [ ] add country code

@boly38
Copy link
Member

boly38 commented Apr 23, 2018

Hi @kumy .
I need your opinion.

about this usecase: waypoint search gives one result, example:
image

In this case, szukaj-ajax.php append 2 informations

Exemple:

  • $typ == "Multicache"
  • $kraj == "Österreich"

What do you think about using some kind of dynamic translation for theses 2 fields values ?
we could also mount a translation from this two codes :

 _('WPTYP_'.$typ)_
 _('WPKRAJ_'.$kraj)_

In our dictionary we will have some entries starting with prefix "WPTYP_" or "WPKRAJ_" to make frontier between waypoint data related entries and geokrety website legacy entries.

Seems the distinct values for this 2 fields are not so big: 10 cache type (Typ) and 35 country (kraj)
distincttyp
distinctkraj

This result in adding 45 entry to crowdin.

What do you think ?

@kumy
Copy link
Member

kumy commented Apr 23, 2018

Yep, go for it. Don't forget to add new strings "in English" and probably in a dedicated file as current strings are extracted from source code and not database… A yaml file would be perfect for this,

boly38 added a commit that referenced this issue Apr 23, 2018
…nty::kraj; opencaching code first; better wording when limit to N results; add translation for search with less than 5 chars
@boly38
Copy link
Member

boly38 commented Apr 23, 2018

probably in a dedicated file as current strings are extracted from source code and not database… A yaml file would be perfect for this,

not understand that point, sorry

@kumy
Copy link
Member

kumy commented Apr 23, 2018

The strings uploaded to crowdin are - until now - extracted from source code using tsmarty2c and xgettext. See

xgettext --from-code=UTF-8 -o $TMP/messages.pot --language=PHP -f website/rzeczy/lang/input-files-for-xgettext
tsmarty2c -o $TMP/smarty.pot ./website/templates/index.html ./website/templates/krety-m.html ./website/templates/krety.html ./website/templates/krety_not_logged_in.html ./website/templates/krety_logged_in.html
msgcat -o website/rzeczy/messages.po.txt $TMP/messages.pot $TMP/smarty.pot

If I'm not mistaken, you want to translate some strings that come from the database (table gk-waypointy). The point I raised was to solve this. "How to inform crowdin about those strings coming from the database?".

So, I suggest to extract/copy those 45 strings out of the database as a static file, as yaml for example. And use a tool to convert .yml file to .po file, like yaml2po. Then merge all our 3 files into one and finally upload it to crowdin. All this should happen in the script cited above L27-29.

Of course, the strings in the database need to be translated into English first, and also be in English in the .yml file.

@boly38
Copy link
Member

boly38 commented Apr 23, 2018

ok thanks for your lights. I will see that and follow this way 🤸

@boly38
Copy link
Member

boly38 commented Apr 26, 2018

hey, finally we have got

110 countries (result in 79 unique english translations)

See

('Albania', 'Albania'),
('Albanien', 'Albania'),
('Argentyna', 'Argentina'),
('Armenia', 'Armenia'),
('Australien', 'Australia'),
('Austria', 'Australia'),
('Belgia', 'Belgium'),
('Belgien', 'Belgium'),
('Białoruś', 'Belarus'),
('Bosnien-Herzegowina', 'Bosnia and Herzegovina'),
('Brasilien', 'Brazil'),
('Bulgarien', 'Bulgaria'),
('Bułgaria', 'Bulgaria'),
('Chiny', 'China'),
('Chorwacja', 'Croatia'),
('Costa Rica', 'Costa Rica'),
('Cypr', 'Cyprus'),
('Czeska Republika', 'Czech Republic'),
('Dänemark', 'Denmark'),
('Dania', 'Denmark'),
('Demokratische Volksrepublik Korea', 'North Korea'),
('Deutschland', 'Germany'),
('Ecuador', 'Ecuador'),
('Egipt', 'Egypt'),
('Estonia', 'Estonia'),
('Falklandinseln', 'Falkland Islands'),
('Färöer (zu Dänemark)', 'Faroe Islands'),
('Finlandia', 'Finland'),
('Finnland', 'Finland'),
('Francja', 'France'),
('Frankreich', 'France'),
('Georgien', 'Georgia'),
('Gibraltar', 'Gibraltar'),
('Grecja', 'Greece'),
('Griechenland', 'Greece'),
('Grönland', 'Greenland'),
('Großbritannien', 'United Kingdom'),
('Hiszpania', 'Spain'),
('Holandia', 'Netherlands'),
('Indie', 'India'),
('Irland', 'Ireland'),
('Irlandia', 'Ireland'),
('Island', 'Iceland'),
('Islandia', 'Iceland'),
('Israel', 'Israel'),
('Italien', 'Italy'),
('Kambodża', 'Cambodia'),
('Kasachstan', 'Kazakhstan'),
('Kenia', 'Kenya'),
('Kirgistan', 'Kyrgyzstan'),
('Kroatien', 'Croatia'),
('Litwa', 'Lithuania'),
('Luxemburg', 'Luxembourg'),
('Łotwa', 'Latvia'),
('Malta', 'Malta'),
('Marokko', 'Morocco'),
('Maroko', 'Morocco'),
('Mauritius', 'Mauritius'),
('Mazedonien', 'Macedonia'),
('Mołdawia', 'Moldova'),
('Monako', 'Monaco'),
('Nepal', 'Nepal'),
('Neuseeland', 'New Zealand'),
('Niderlandy', 'Netherlands'),
('Niederlande', 'Netherlands'),
('Niederländische Antillen', 'Netherlands Antilles'),
('Niemcy', 'Germany'),
('Norwegen', 'Norway'),
('Norwegia', 'Norway'),
('Österreich', 'Austria'),
('Polen', 'Poland'),
('Polska', 'Poland'),
('Portugal', 'Portugal'),
('Portugalia', 'Portugal'),
('Rosja', 'Russia'),
('Rumänien', 'Romania'),
('Rumunia', 'Romania'),
('Russische Föderation', 'Russia'),
('Schweden', 'Sweden'),
('Schweiz', 'Switzerland'),
('Serbien', 'Serbia'),
('Serbien und Montenegro', 'Serbia and Montenegro'),
('Seychellen', 'Seychelles'),
('Simbabwe', 'Zimbabwe'),
('Slowenien', 'Slovenia'),
('Słowacja', 'Slovakia'),
('Spanien', 'Spain'),
('Südgeorgien und die Südlichen Sandwichinseln', 'South Georgia and the South Sandwich Islands'),
('Svalbard und Jan Mayen', 'Svalbard and Jan Mayen'),
('Szwajcaria', 'Switzerland'),
('Szwecja', 'Sweden'),
('Tajlandia', 'Thailand'),
('Thailand', 'Thailand'),
('Tschechische Republik', 'Czech Republic'),
('Tunezja', 'Tunisia'),
('Turcja', 'Turkey'),
('Türkei', 'Turkey'),
('Uganda', 'Uganda'),
('Ukraina', 'Ukraine'),
('Ungarn', 'Hungary'),
('USA', 'USA'),
('Usbekistan', 'Uzbekistan'),
('Vereinigte Staaten', 'United States'),
('Vietnam', 'Vietnam'),
('Volksrepublik China', 'China'),
('Węgry', 'Hungary'),
('Wielka Brytania', 'United Kingdom'),
('Wietnam', 'Vietnam'),
('Włochy', 'Italy'),
('Zjednoczone Emiraty Arabskie', 'United Arab Emirates')

19 cache types (result in 14 unique english translations)

See

('beweglicher Cache', 'Mobile'),
('Drive-In-Cache', 'Drive-In'),
('Event-Cache', 'Event'),
('Mathe-/Physikcache', 'Math / physics cache'),
('Mobilna', 'Mobile'),
('Multicache', 'Multicache'),
('normaler Cache', 'Traditional'),
('Own cache', 'Own cache'),
('Podcast cache', 'Podcast cache'),
('Quiz', 'Quiz'),
('Rätselcache', 'Mystery'),
('Skrzynka nietypowa', 'Unusual box'),
('Tradycyjna', 'Traditional'),
('unbekannter Cachetyp', 'Unknown cache'),
('virtueller Cache', 'Virtual'),
('Webcam', 'Webcam'),
('Webcam-Cache', 'Webcam'),
('Wirtualna', 'Virtual'),
('Wydarzenie', 'Event')

You could put an eye to see any error.

Next step: crowdin input

@kumy following you advice, and out of error, seems we are not already using yaml2po , BTW we already have some translations detected by tsmarty2c from simple html template. I think first I will generate simple html with template for each.

@boly38
Copy link
Member

boly38 commented Apr 26, 2018

So I think we're no so far (for translations only, I need to work a little bit more on webpage)
https://github.com/geokrety/geokrety-website/blob/perso/boly/website/templates/waypointy-translations.html

is generated by

https://github.com/geokrety/geokrety-scripts/blob/feature/waypointy-translations/waypointy/oc/waypointy-translations.php

boly38 added a commit that referenced this issue Apr 27, 2018
Use crowdin translations for waypointy::typ and waypointy::kraj

- add 2 tables to mysql schema
- add waypointy-translations.html generated smarty template
  cf. geokrety-scripts / waypointy /oc / waypointy-translations.php

Update ruchy.php UI

- when multiple caches as result: opencaching code first
- add translation for search error when name is less than 5 chars
- better wording when limit to N results
- start with PHPOO : lib/Waypointy ; fix szukaj-ajax.php ;

Docker scripts

- improve update.sh : onefile arg, alias, die error message
- improve install.sh : fix first time exit 1

Travis

- check crlf : ignore .(*)
boly38 added a commit that referenced this issue May 4, 2018
Use crowdin translations for waypointy::typ and waypointy::kraj

- add 2 tables to mysql schema
- waypointy-translations.html must be generated using php:
  cf. geokrety-scripts / waypointy /oc / waypointy-translations.php

Update ruchy.php UI

- when multiple caches as result: opencaching code first
- add translation for search error when name is less than 5 chars
- better wording when limit to N results
- start with PHPOO : lib/Waypointy ; fix szukaj-ajax.php ; use prepared statement

Docker scripts

- improve update.sh : onefile arg, alias phplogs phplogsf, die error message
- improve install.sh : fix first time exit 1
- update SQL schema creation with legacy one

Travis

- check crlf : ignore .(*)
- phpcs using bracket on same line rule

Co-authored-by: Mathieu Alorent <github@kumy.net>
boly38 added a commit that referenced this issue May 4, 2018
Use crowdin translations for waypointy::typ and waypointy::kraj

- add 2 tables to mysql schema
- waypointy-translations.html must be generated using php:
  cf. geokrety-scripts / waypointy /oc / waypointy-translations.php

Update ruchy.php UI

- when multiple caches as result: opencaching code first
- add translation for search error when name is less than 5 chars
- better wording when limit to N results
- start with PHPOO : lib/Waypointy ; fix szukaj-ajax.php ; use prepared statement

Docker scripts

- improve update.sh : onefile arg, alias phplogs phplogsf, die error message
- improve install.sh : fix first time exit 1
- update SQL schema creation with legacy one

Travis

- check crlf : ignore .(*)
- phpcs using bracket on same line rule

Co-authored-by: Mathieu Alorent <github@kumy.net>
boly38 added a commit that referenced this issue Jun 8, 2018
Use crowdin translations for waypointy::typ and waypointy::kraj

- add 2 tables to mysql schema
- waypointy-translations.html must be generated using php:
  cf. geokrety-scripts / waypointy /oc / waypointy-translations.php

Update ruchy.php UI

- when multiple caches as result: opencaching code first
- add translation for search error when name is less than 5 chars
- better wording when limit to N results
- start with PHPOO : lib/Waypointy ; fix szukaj-ajax.php ; use prepared statement

Docker scripts

- improve update.sh : onefile arg, alias phplogs phplogsf, die error message
- improve install.sh : fix first time exit 1
- update SQL schema creation with legacy one

Travis

- check crlf : ignore .(*)
- phpcs using bracket on same line rule

Co-authored-by: Mathieu Alorent <github@kumy.net>
boly38 added a commit that referenced this issue Jun 14, 2018
Use crowdin translations for waypointy::typ and waypointy::kraj

- add 2 tables to mysql schema
- waypointy-translations.html must be generated using php:
  cf. geokrety-scripts / waypointy /oc / waypointy-translations.php

Update ruchy.php UI

- when multiple caches as result: opencaching code first
- add translation for search error when name is less than 5 chars
- better wording when limit to N results
- start with PHPOO : lib/Waypointy ; fix szukaj-ajax.php ; use prepared statement

Docker scripts

- improve update.sh : onefile arg, alias phplogs phplogsf, die error message
- improve install.sh : fix first time exit 1
- update SQL schema creation with legacy one

Travis

- check crlf : ignore .(*)
- phpcs using bracket on same line rule

Co-authored-by: Mathieu Alorent <github@kumy.net>
kumy added a commit that referenced this issue Jun 14, 2018
Use crowdin translations for waypointy::typ and waypointy::kraj

- add 2 tables to mysql schema
- waypointy-translations.html must be generated using php:
  cf. geokrety-scripts / waypointy /oc / waypointy-translations.php

Update ruchy.php UI

- when multiple caches as result: opencaching code first
- add translation for search error when name is less than 5 chars
- better wording when limit to N results
- start with PHPOO : lib/Waypointy ; fix szukaj-ajax.php ; use prepared statement

Docker scripts

- improve update.sh : onefile arg, alias phplogs phplogsf, die error message
- improve install.sh : fix first time exit 1
- update SQL schema creation with legacy one

Travis

- check crlf : ignore .(*)
- phpcs using bracket on same line rule

Co-authored-by: Mathieu Alorent <github@kumy.net>
boly38 added a commit that referenced this issue Jun 15, 2018
Use crowdin translations for waypointy::typ and waypointy::kraj

- add 2 tables to mysql schema
- waypointy-translations.html must be generated using php:
  cf. geokrety-scripts / waypointy /oc / waypointy-translations.php

Update ruchy.php UI

- when multiple caches as result: opencaching code first
- add translation for search error when name is less than 5 chars
- better wording when limit to N results
- start with PHPOO : lib/Waypointy ; fix szukaj-ajax.php ; use prepared statement

Docker scripts

- improve update.sh : onefile arg, alias phplogs phplogsf, die error message
- improve install.sh : fix first time exit 1
- update SQL schema creation with legacy one

Travis

- check crlf : ignore .(*)
- phpcs using bracket on same line rule

Co-authored-by: Mathieu Alorent <github@kumy.net>
@kumy kumy closed this as completed in 8df4201 Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants