How do I use translation module in vibe.d?

aberba karabutaworld at gmail.com
Tue Oct 13 08:03:26 UTC 2020


On Friday, 9 October 2020 at 21:07:28 UTC, jack wrote:
> Documentation[1] tells to use 
> @translationModule!TranslationContext on class, like this:
>
>> [...]
>
> but it return the error:
>
>>  [...]
>
> it seems that construtor was removed[2] but I can't find the 
> replacement anywhere. Could someone help with that?
>
> [1]: see "location" section: https://vibed.org/docs#Localization
> [2]: https://vibed.org/api/search?q=translationModule


Did you do this?

> Using GNU gettext compatible .po translation files, it's 
> possible to localize Diet templates at compile time. This just 
> requires putting the translation files with the naming scheme 
> <name>.<language>.po into a path that is registered in the 
> "stringImportPaths" field of the dub.json. <language> must be a 
> language identifier of the form en_US.


More information about the Digitalmars-d-learn mailing list