Repository navigation
Translations
KeyAnyWhere's interface is written in Brazilian Portuguese, and every phrase goes through CakePHP's translation functions so it can be shown in other languages. Today the other language is Latin American Spanish. This page explains where the translations live, how to add a phrase without breaking the Spanish interface, and how to add a new language.
-
Brazilian Portuguese (
pt_BR) is the source text: it is the string inside__()in the code and templates. There is nopt_BRfile. -
Spanish (
es) isresources/locales/es/default.po, with the phrases of the core. - The list of languages offered on the Configurações gerais screen is
App\I18n\Regional::IDIOMAS.
Every new __() phrase needs its Spanish translation in resources/locales/es/default.po, in the same pull request. That includes text that elements translate for you, such as a button's texto passed to btnNovo, parts of the breadcrumb, tooltips and flash messages.
msgid "Nova entrada"
msgstr "Nueva entrada"Flash messages are passed untranslated by the controller ($this->Flash->success('Salvo com sucesso')): the flash element translates them, so they need an entry in the .po file too.
Clear the translation cache, set the language to Español in Configurações gerais and open the screen you changed:
bin/cake cache clear _cake_translations_- Create
resources/locales/<locale>/default.po(for exampleen_US), with the samemsgidentries as the Spanish file. - Add the locale to
Regional::IDIOMAS, with its name written in that language. - Run the tests:
Regional::idiomaDoNavegador()uses that list to pick the language of the first-run setup from the browser'sAccept-Languageheader.
Source code · Issues · Releases · Packagist · Online demo · Hosted edition
1. Getting started
2. Installing in production
- Overview
- Preparing the Server
- Installing KeyAnyWhere
- File Permissions
- Generating Security Keys
- Environment Variables
- Configuration Files
- Database Setup
- Insecure Password Catalog
- Web Server and HTTPS
- First-Run Setup
3. Operating your installation
4. Using KeyAnyWhere
5. Security
6. Development
7. Extending