FarmOS translating problem

I’ve been translating FarmOS for Norwegian, and general user interface is quite complete now.
But the quantity, log and resource types will not show their translation.
They are translated here: …/admin/config/regional/config-translation/log_type

Did anyone have any luck with this?
I’m hosted on Farmier.
I tried creating and loggingin in with a new user. Same result there.

Another issue I have:
E.g.
Norwegian translation of e.g. “Activity logs” is “Aktivitetslogger”
I find this hard to achieve since Activity and logs are two different terms.
Someone with a tip on this?

1 Like

Hah… If ticking a few resources and select Add log, the translated log types are populated in the dropdown.
But not in the menus.

1 Like

I also found that menu items (specifically the asset, log, quantity and plan types under the “Records” menu item) are not being translated, mentioned here: https://github.com/farmOS/farmOS/issues/472#issuecomment-1017968157

I think I know where we need to fix that. I will take a look next time I have a chance.

1 Like

@mstenta Someone has been working…
Menus are displayed in translated language now.

1 Like

Huh. It wasn’t me! Now I’m really confused… :thinking:

Hmm… Well. Added the medical log module, and compost, and translated tehm.
They don’t come up translated (yet)

I changed one translation now to see what happens.

1 Like

@pat Are they translated now? I just enabled another module (config_update_ui so I could check your config entities) and maybe that did it…

I’m noticing that when modules get enabled, they trigger something in the translations to get updated… so this might explain what we’re seeing. Perhaps clearing the cache is not enough, and another specific language update function needs to run to update certain things (like menu).

There is a drush locale:update command:

locale:update Imports the available translation updates.

I wonder if running this would refresh the menus to pick up new translations. Maybe worth a try… let me know if you translate anything else and we can test to see if it does the trick.

Ah. That did it… The new modules I added yesterday was translated now, and also the one I changed recently.

:upside_down_face:

Ok interesting! I’d like to confirm whether or not the drush locale:update command will do the same thing. Let me know if you translate anything else in the menu, and I can try running that to see if it fixes it.

Just found this. Maybe I can try it on my system as well. :smiley:

Or do you meanwhile found another way of fixing the “menus are not translated”-bug?

1 Like

@SirSundays I think that was the missing piece! But I would still like to confirm it. If you have a chance to try, please do!

@mstenta I just translated a resource type. It’s not automatically updated.
In case you would test.

1 Like

Thanks @pat - What resource type did you translate, so I can check myself to see if this works… I’ll confirm that it is in English, then run drush locale:update, and check again to see if it was translated afterwards.

@mstenta The land resource…

1 Like

@mstenta If you check my instance, its already translated with 2 – at the end.
I did change those to ++ 5 mins ago.

1 Like

Hmm I ran drush locale:update and it seems to have done the opposite of what I wanted… ALL of the menu items under Records > Assets are in English now. :frowning:

This is what I saw when I ran the command:

>  [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/admin_toolbar/admin_toolbar-8.x-2.5.nb.po.
>  [notice] Checked nb translation for admin_toolbar.
>  [notice] Checked nb translation for consumers.
>  [notice] Checked nb translation for date_popup.
>  [notice] Checked nb translation for entity_browser.
>  [notice] Checked nb translation for farm_map_google.
>  [notice] Checked nb translation for fraction.
>  [notice] Checked nb translation for geofield.
>  [notice] Checked nb translation for inline_entity_form.
>  [notice] Checked nb translation for inspire_tree.
>  [notice] Checked nb translation for jsonapi_schema.
>  [notice] Checked nb translation for role_delegation.
>  [notice] Checked nb translation for simple_oauth.
>  [notice] Checked nb translation for smtp.
>  [notice] Checked nb translation for state_machine.
>  [notice] Checked nb translation for subrequests.
>  [notice] Checked nb translation for token.
>  [notice] Checked nb translation for views_geojson.
>  [notice] Checked nb translation for gin.
>  [notice] Checked nb translation for config_update.
>  [notice] Checked nb translation for csv_serialization.
>  [notice] Checked nb translation for entity.
>  [notice] Checked nb translation for entity_reference_integrity.
>  [notice] Checked nb translation for entity_reference_revisions.
>  [notice] Checked nb translation for entity_reference_validators.
>  [notice] Checked nb translation for exif_orientation.
>  [notice] Translation file not found: https://ftp.drupal.org/files/translations/all/farm_nrcs/farm_nrcs-2.0.1.nb.po.
>  [notice] Checked nb translation for farm_nrcs.
>  [notice] Checked nb translation for jsonapi_extras.
>  [notice] Checked nb translation for log.
>  [notice] Checked nb translation for drupal.
>  [notice] Downloaded nb translation for drupal.
>  [notice] Importing nb translation for drupal. (0%).
>  [notice] Importing nb translation for drupal. (1%).
>  [notice] Importing nb translation for drupal. (1%).
>  [notice] Importing nb translation for drupal. (2%).
>  [notice] Importing nb translation for drupal. (2%).
>  [notice] Importing nb translation for drupal. (3%).
>  [notice] Importing nb translation for drupal. (4%).
>  [notice] Importing nb translation for drupal. (5%).
>  [notice] Importing nb translation for drupal. (6%).
>  [notice] Importing nb translation for drupal. (7%).
>  [notice] Importing nb translation for drupal. (9%).
>  [notice] Importing nb translation for drupal. (10%).
>  [notice] Importing nb translation for drupal. (11%).
>  [notice] Importing nb translation for drupal. (13%).
>  [notice] Importing nb translation for drupal. (15%).
>  [notice] Importing nb translation for drupal. (16%).
>  [notice] Importing nb translation for drupal. (18%).
>  [notice] Importing nb translation for drupal. (19%).
>  [notice] Importing nb translation for drupal. (20%).
>  [notice] Importing nb translation for drupal. (22%).
>  [notice] Importing nb translation for drupal. (23%).
>  [notice] Importing nb translation for drupal. (25%).
>  [notice] Importing nb translation for drupal. (27%).
>  [notice] Importing nb translation for drupal. (28%).
>  [notice] Importing nb translation for drupal. (30%).
>  [notice] Importing nb translation for drupal. (32%).
>  [notice] Importing nb translation for drupal. (34%).
>  [notice] Importing nb translation for drupal. (35%).
>  [notice] Importing nb translation for drupal. (36%).
>  [notice] Importing nb translation for drupal. (37%).
>  [notice] Importing nb translation for drupal. (40%).
>  [notice] Importing nb translation for drupal. (42%).
>  [notice] Importing nb translation for drupal. (44%).
>  [notice] Importing nb translation for drupal. (47%).
>  [notice] Importing nb translation for drupal. (50%).
>  [notice] Importing nb translation for drupal. (57%).
>  [notice] Importing nb translation for drupal. (63%).
>  [notice] Importing nb translation for drupal. (66%).
>  [notice] Importing nb translation for drupal. (69%).
>  [notice] Importing nb translation for drupal. (71%).
>  [notice] Importing nb translation for drupal. (73%).
>  [notice] Importing nb translation for drupal. (76%).
>  [notice] Importing nb translation for drupal. (78%).
>  [notice] Importing nb translation for drupal. (80%).
>  [notice] Importing nb translation for drupal. (83%).
>  [notice] Importing nb translation for drupal. (87%).
>  [notice] Importing nb translation for drupal. (91%).
>  [notice] Importing nb translation for drupal. (94%).
>  [error]  Import of string "Kunne ikke koble til serveren. Serveren gir følgende melding: <p class = "error">@message</p>. For mer hjelp med å legge til eller oppdatere koden på serveren din, se <a href=":handbook_url">håndboka</a>." was skipped because of disallowed or malformed HTML. 
>  [notice] Importing nb translation for drupal. (95%).
>  [notice] Imported nb translation for drupal.
>  [notice] Translations imported: 32 added, 9795 updated, 0 removed.
>  [warning] 1 disallowed HTML string(s) in files: translations://drupal-9.3.3.nb.po.
>  [warning] Message: One translation string was skipped because of disallowed or malformed HTML. 
> See the log for details.
> 
>  [notice] Message: One translation file imported. /32/ translations were added, /9795/ 
> translations were updated and /0/ translations were removed.
>

After that, the menus were unchanged, BUT the title at the top of /assets/land changed from " Landområder-- ressurs" to “Landområder++ ressurs”.

So then I cleared the cache with drush cr - and the menus all changed to English. :frowning:

Re-running drush locale:update again after that results in:

>  [warning] No configuration objects have been updated.
>  [notice] Message: No configuration objects have been updated.
>

Clearing the cache again did not fix it.

So I’m not sure what’s going on with the menus…

AH HA! But then: I tried enabling a module, and it fixed the menus!

So something is happening when a module is enabled/disabled that affects the translation of the menu items in particular… :thinking:

FYI pasting a link to a Slack conversation with Drupal core maintainer Gabor regarding exporting *.potx files from localize.drupal.org for future reference: Slack

Ah… Then maybe it was me enabling the quickform module some days back that made the first translation…

1 Like