# |
Jun 4th 2021, 19:38 |
kevin.pfeifer |
To explain what each file does: *default.pot* is basically just a template file for what can be translated in whatever language you desire *default.po* is the editable translation file for your desired language *default.mo* is the compiled translation file which cakephp actually reads |
# |
Jun 4th 2021, 19:37 |
aengblom |
Thank you, Kevin! This helps a ton! I think I understand it now. |
# |
Jun 4th 2021, 19:36 |
kevin.pfeifer |
so the process would be like 1. generate new `default.pot` file with `bin/cake extract` 2. update already present `default.po` (no t at the end!) with the new `default.pot` file via PoEdit 3. Translate your new strings 4. Save the `default.po` file so PoEdit generates a new `default.mo` 5. Check if strings are translated as you desire in your app 6. If not, do a `bin/cake cache clear_all` |
# |
Jun 4th 2021, 19:34 |
aengblom |
Ok, gotcha |
# |
Jun 4th 2021, 19:33 |
kevin.pfeifer |
which you then can translate |
# |
Jun 4th 2021, 19:33 |
kevin.pfeifer |
and now it should contain your new strings |
# |
Jun 4th 2021, 19:33 |
kevin.pfeifer |
then select the newly generated default.pot file |
# |
Jun 4th 2021, 19:33 |
kevin.pfeifer |
and select "Update from POT File" |
# |
Jun 4th 2021, 19:32 |
kevin.pfeifer |
then in the menu at top go to "Catalogue" |
# |
Jun 4th 2021, 19:32 |
aengblom |
ok |
# |
Jun 4th 2021, 19:32 |
kevin.pfeifer |
open that with poedit |
# |
Jun 4th 2021, 19:32 |
kevin.pfeifer |
ok good, so you have a default.po file |
# |
Jun 4th 2021, 19:32 |
aengblom |
yes, poedit |
# |
Jun 4th 2021, 19:31 |
kevin.pfeifer |
PoEdit? |
# |
Jun 4th 2021, 19:31 |
kevin.pfeifer |
with what file do you edit/translate your .po file |
# |
Jun 4th 2021, 19:31 |
kevin.pfeifer |
:) |
# |
Jun 4th 2021, 19:31 |
aengblom |
Ok, this is where I am fuzzy |
# |
Jun 4th 2021, 19:30 |
kevin.pfeifer |
and you updated your .po file in your language with that new .pot file |
# |
Jun 4th 2021, 19:30 |
aengblom |
Yep |
# |
Jun 4th 2021, 19:29 |
kevin.pfeifer |
and inside your .pot file does the file/line also appear in the comments for that string? |
# |
Jun 4th 2021, 19:28 |
aengblom |
Yep, I did the extract command |
# |
Jun 4th 2021, 19:27 |
kevin.pfeifer |
do you generate your `.pot` file with the cake cli as well? |
# |
Jun 4th 2021, 19:25 |
aengblom |
Thanks for the tip! Unfortunately that didn't do it. I'm fairly new to this translating stuff. I've been studying the cakephp docs on i18n. If anyone has any video resources on the topic they would like to share, I would appreciate it very much. I do much better with videos for some reason. Thanks! |
# |
Jun 4th 2021, 19:17 |
kevin.pfeifer |
sometimes I need to do a `bin/cake cache clear_all` to have all newly tranlated strings be loaded correctly |
# |
Jun 4th 2021, 19:13 |
aengblom |
Has anyone ever encountered certain strings not translating even when __() is used and the string is translated in the po file? Nearly everything else in the app is translating except for a few strings. I'm not sure what is going on |
# |
Jun 4th 2021, 19:05 |
kevin.pfeifer |
sometimes its all just so flexible and can be re-used in so many places that it is hard to communicate a specific problem ^^ |
# |
Jun 4th 2021, 19:04 |
kevin.pfeifer |
but as you said Zuluru, Helpers are for Views (the V in MVC) :) However one decides to use that V :) |
# |
Jun 4th 2021, 19:03 |
greg138 |
And hence my question. ;) |
# |
Jun 4th 2021, 19:02 |
kevin.pfeifer |
sure. it depends what you define as backend and frontend :) |
# |
Jun 4th 2021, 19:02 |
greg138 |
And helpers can obviously be used in the views for admin pages. :) |
# |
Jun 4th 2021, 19:02 |
greg138 |
Some people consider "the admin pages" to be "backend", though... |
# |
Jun 4th 2021, 19:01 |
kevin.pfeifer |
shared backend logic can be inside components for controller or behaviours for models |
# |
Jun 4th 2021, 19:01 |
kevin.pfeifer |
the name "helper" in cakephp is mainly reserved for frontend logic |
# |
Jun 4th 2021, 19:01 |
greg138 |
What do you mean by "backend"? Helpers are for views. |
# |
Jun 4th 2021, 18:58 |
rightscoreanalysis |
Are Helpers for Cake mainly for the front end - since they reside in the 'view' folder. Does Cake not use Helpers for the backend? |
# |
Jun 4th 2021, 18:47 |
kevin.pfeifer |
I am currently thinking about implementing an e2e testing framework into my cakephp app and was just wondering of someone here has already some (good or bad) experience with a specific one :) |
# |
Jun 4th 2021, 16:48 |
kevin.pfeifer |
true that |
# |
Jun 4th 2021, 16:43 |
admad |
I actually don't mind the naked BS in backends but greatly dislike the BS "smell" in fronted designs |
# |
Jun 4th 2021, 16:43 |
kevin.pfeifer |
for the whole JS/SCSS generation |
# |
Jun 4th 2021, 16:43 |
kevin.pfeifer |
i also "still" use gulp4 instead of webpack or any other modern package bundler because it has everything I need and is not that complicated :) |
# |
Jun 4th 2021, 16:42 |
admad |
:+1: |