Skip to content

Making module multi-language #6

@juergenweb

Description

@juergenweb

Hola Eduardo

First of all, I have not discovered any new issues - the module works as expected :-)

So I came up with a request: It would be great if you would make the module fully translatable.

At the moment there are only a view translatable strings included and most of the inputfield strings are not translatable.
I have created a fork of your module at my GitHub account, where I implemented all the translations.

Screenshot 2023-03-17 at 16-46-07 Bearbeite Seite Zuhause • webseite1 at

As you can see all the texts are in German and they can be easily translated via the admin in the backend. :-)

Would be great if you include my changes inside your version, because I think other peoples will also be interested in.

The following files have been changed:

  • InputfieldRecurringDates.js
  • AlpineComponent.php
  • InputfieldRecurringDates.module

You can find my fork here.

In AlpineComponent.php you have to add the textdomain next to the text. This is necessary to be able to load the translations, because this file will be integrated inside another file. Otherwise the translator will not find the translations.

The translations inside InputfieldRecurringDates.js will be defined inside the InputfieldRecurringDates.module. For this case I have created an new method, which holds the translation string called jsTranslations(). This is necessary to create Javascript variables via the PW $config->Js method.

I guess the best is you take a look at the files to see, what I have changed.

Have a nice weekend!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions