judicialcouncilcalifornia / docassemble.jcc.abilitytopay

https://mycitations.courts.ca.gov
MIT License
0 stars 0 forks source link

Implement Spanish translation #99

Closed bennlich closed 4 years ago

bennlich commented 5 years ago

Once we get the Spanish translations for the interview content, we need to implement a feature to switch languages in the interview.

@JCCChris I've more or less mocked up a yaml structure that I think will work in the UAT playground: https://mycitations.uat.courts.ca.gov/playground. The components are:

See it on the playground here: https://mycitations.uat.courts.ca.gov/interview?i=docassemble.playground1%3Aa2p-entrypoint.yml#page1

I think the remaining tasks are: 1) Pull the code blocks out of a2p-en and a2p-es into a code.yml (so that we don't have to change the logic in both files when we need to make changes.) 2) Insert all the spanish translations into the appropriate places in a2p-es.yml 3) For messages that appear in code.yml, for example errors like this one, use a lookup table to get strings in the correct language. I.e. we need a function like get_e18n_message('ineligible_citation_error', user_language) that returns the ineligible_citation_error text in the appropriate language.

JCCChris commented 5 years ago

@bennlich I've created a translation.yml file and switched interview.yml to use the dictionary lookup. I think we need to adjust the language selection mechanism still.

JCCChris commented 4 years ago

Currently working in Spanish on production.