Hi Juliano,
Adding a new language involves several steps due to how poorly language support was initially implemented in IvozProvider (our fault!).
Here’s an overview of the tasks required to support a new language:
Add a new language entry to the Languages table (via a database migration).
Add a new column in all multilingual entities (also via a database migration).
Examples of multilingual entities include: Destinations, RatingPlanGroups, etc.
Add the corresponding Asterisk sound files for the new language (or reuse an existing language set if appropriate).
Define default notification contents for all email notification types (Voicemails, Faxes, Low Balance alerts, CSV reports, etc.).
And of course, provide translations for all translatable fields across the platform, including the brand, client, and user portals.
As you can see, it’s not a trivial task. However, we may introduce support for a new language in an upcoming 4.x release (exact timing still TBD), which you could use as a reference for implementing all the required changes.
Best regards,
Hi,
As I mentioned earlier, it's not an easy task.
For database changes, please follow these steps:
Edit the ORM XML files for each table that uses multilang. For example:
https://github.com/irontec/ivozprovider/blob/main/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/Currency.Name.orm.xml
Remove the cache directory:
/opt/irontec/ivozprovider/schema/var/cache
Generate a migration for the ORM changes by running:
/opt/irontec/ivozprovider/schema/bin/console doctrine:migrations:diff
Edit the generated migration file to set the new field values and add the necessary updates to the affected tables.
Update the model files to include the new fields by running:
/opt/irontec/ivozprovider/schema/bin/run-generators Provider
Otherwise, the APIs won’t return the new fields.
Apply the migration by executing:
/opt/irontec/ivozprovider/schema/bin/console doctrine:migrations:migrate -n
Keep in mind that this will also require updating fixtures, API tests, and other related components.
As I mentioned, adding a new language is not an easy task, so it may be easier for you to replace an existing one for now—at least until you have a pull request to use as a reference. (We're planning to add a new language soon.)
Best Regards,
Kaian