www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How do I use translation module in vibe.d?

reply jack <jckj33 gmail.com> writes:
Documentation[1] tells to use 
 translationModule!TranslationContext on class, like this:

  translationModule!TranslationContext
 class WebInterface {
 ...
but it return the error:
 Error: template instance translationModule!(TranslationContext) 
 does not match template  declaration translationModule(string 
 FILENAME)
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
Oct 09 2020
next sibling parent reply aberba <karabutaworld gmail.com> writes:
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.
Oct 13 2020
parent Jack <jckj33 gmail.com> writes:
On Tuesday, 13 October 2020 at 08:03:26 UTC, aberba wrote:
 On Friday, 9 October 2020 at 21:07:28 UTC, jack wrote:
 [...]
Did you do this?
 [...]
Yes, I did exacly that.
Oct 13 2020
prev sibling next sibling parent reply aberba <karabutaworld gmail.com> writes:
On Friday, 9 October 2020 at 21:07:28 UTC, jack wrote:
 Documentation[1] tells to use 
  translationModule!TranslationContext on class, like this:

  translationModule!TranslationContext
 class WebInterface {
 ...
but it return the error:
 Error: template instance 
 translationModule!(TranslationContext) does not match template
  declaration translationModule(string FILENAME)
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
https://www.github.com/vibe-d/vibe.d/tree/master/examples%2Fweb-i18n There's also an example here
Oct 13 2020
parent reply Jack <jckj33 gmail.com> writes:
On Tuesday, 13 October 2020 at 08:07:17 UTC, aberba wrote:
 On Friday, 9 October 2020 at 21:07:28 UTC, jack wrote:
 Documentation[1] tells to use 
  translationModule!TranslationContext on class, like this:

  translationModule!TranslationContext
 class WebInterface {
 ...
but it return the error:
 Error: template instance 
 translationModule!(TranslationContext) does not match template
  declaration translationModule(string FILENAME)
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
https://www.github.com/vibe-d/vibe.d/tree/master/examples%2Fweb-i18n There's also an example here
My dub.json file and folder structure is exactly this one, as the tutorial told to do yet I get the compilation error. I guess the library was updated but the documentation didn't
Oct 13 2020
parent aberba <karabutaworld gmail.com> writes:
On Tuesday, 13 October 2020 at 17:02:54 UTC, Jack wrote:
 On Tuesday, 13 October 2020 at 08:07:17 UTC, aberba wrote:
 On Friday, 9 October 2020 at 21:07:28 UTC, jack wrote:
 [...]
https://www.github.com/vibe-d/vibe.d/tree/master/examples%2Fweb-i18n There's also an example here
My dub.json file and folder structure is exactly this one, as the tutorial told to do yet I get the compilation error. I guess the library was updated but the documentation didn't
I'll have to try that. I haven't really used vibe.d translation myself beyond learning... and that was a long time ago.
Oct 17 2020
prev sibling parent reply aberba <karabutaworld gmail.com> writes:
On Friday, 9 October 2020 at 21:07:28 UTC, jack wrote:
 Documentation[1] tells to use 
  translationModule!TranslationContext on class, like this:

  translationModule!TranslationContext
 class WebInterface {
 ...
but it return the error:
 Error: template instance 
 translationModule!(TranslationContext) does not match template
  declaration translationModule(string FILENAME)
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
D dlang discord is a great place to also reach out. There's a dlang webdev channel.
Oct 13 2020
parent Jack <jckj33 gmail.com> writes:
On Tuesday, 13 October 2020 at 08:08:54 UTC, aberba wrote:
 On Friday, 9 October 2020 at 21:07:28 UTC, jack wrote:
 Documentation[1] tells to use 
  translationModule!TranslationContext on class, like this:

  translationModule!TranslationContext
 class WebInterface {
 ...
but it return the error:
 Error: template instance 
 translationModule!(TranslationContext) does not match template
  declaration translationModule(string FILENAME)
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
D dlang discord is a great place to also reach out. There's a dlang webdev channel.
I'll check out those, thanks!
Oct 13 2020