Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By gaborm on
Hi!
How to use the D8 .po translations in my module after module install?
# mymodule.info.yml
name: mymodule
core: 8.x
version: 1
type: module
package: mymodule
description: My module.
interface translation project: mymodule
interface translation server pattern: modules/mymodule/translations/%project-%language.p
The lang file is:
mymodule/translations/mymodule-hu.po
The drush did not use it!
drush locale-check
drush locale-update
drush cr
When does the D8 load the translations (.po files) during installation?
(In D7 it worked.)
Comments
=-=
https://www.drupal.org/forum/support/module-development-and-code-questio...
solution?
is it the solution?
How to use it?
not working
it's not working.
I removed the module and reinstall it. But the translation file (.po) did not load.
The drush command did not work too!
I need to import it (.po file). (Only import function works.)
what is missing?
works
it seems it is working.
https://drupal.stackexchange.com/questions/152160/how-can-i-deploy-user-...
for example:
It can to call in:
hook_install()
hook_updateX()
That's a good follow up,
That's a good follow up, thank you.
Import via Drupal UI
Just to have it complete:
if translations are defined via '
interface translation server pattern
' in the mymodule.info.yml, they will be picked up by `/admin/reports/translations` and can then be imported there kind of automatically. One usually has to do this anyway after module updates.Best wishes
Andreas
Missing "o" in ".po"
Too late to the party, but there seems to be a missing "o" in the ".po" in the "interface translation server pattern" value.