![]() Some basic information about GetText portable objects copy + paste from That is a standard format - not standard library. The so called “GetText portable object”-Format. Translation files (".po" and “.pot”) are textfiles (You can open it with any text editor) in Is localization something that depends on some external, standardized translation library? ![]() ![]() See: Internationalization & Localization - 4.x Under “resources/locales/” + directory name of your translation e.g. Where and how to keep alternate languages is unclear to me. The language is stored in the session and is read in “AppController” in “beforeFilter” from the session which sets the language on runtime with In addition, a user who logs in can select the language on login. Language identifier in the HTTP request calls the CakePHP application. So that the application automatically switches to the correct language when a browser with a different I then adjust the “defaultLocale” to “de” and activate the middleware ( Internationalization & Localization - 4.x) The generated files in the other languages will be stored where CakePHP wants to have it according to the docu/book. Partly automatically by a translation service integrated in PoEdit. I create a PO file later and translate it with the program. _(“Das ist eine Überschrift”)Įven without the translation file this text is shown. What do you mean by “deeper dive”? For someone who has done nothing with i18n/localization before the book description can be very extensive (“Creating Message Parsers”, “Creating Generic Translators”, etc…) and if you haven’t done localization before it can be rather confusing.īut after a while the i18n/localization in CakePHP 4 very simple for me.ĭo you know the i18n tool? I18N Tool - 4.x - very helpfull:Īt the beginning of the development I use everywhere the global _() function: e.g. (and also as a way to retain the option to support all variations instead of committing to one). Knowing full well that supporting other languages in the future also means changing “Cars” to whatever word needed, I would like to play around with that right away but simply as a means to make it easy to swap certain wordings I choose in the GUI without having to search and replace on the backend or refactor, etc. I’m specifically looking to get started with something very simple… actually, not looking just yet for supporting more than one language but instead seeking to use it as a means to switch/customize the vocabulary used in my app.įor example: to seamlessly and easily support changing the way a model/controller name is displayed across the entire application depending on user preference - as if I designed my app for “Cars” and decide I want to support an alternative “Autos” instead. I am wondering if anyone might know of and share a deeper dive than what’s in the Book about using localization in CakePHP (particularly for someone who has never done any kind of localization work before)?
0 Comments
Leave a Reply. |