Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the layout of the outputOther? #43

Open
velidan opened this issue Nov 23, 2020 · 1 comment
Open

How to change the layout of the outputOther? #43

velidan opened this issue Nov 23, 2020 · 1 comment

Comments

@velidan
Copy link

velidan commented Nov 23, 2020

Hi everyone and thanks for the awesome lib.
I have an issue: I have the English and German languages and I need to receive at the output index_en.html and index_de.html

The question: How to do it?

I managed how to change the default language name (en) by just hardcoding it in the config but I can't do the same for other languages because they should be dynamic.

Thanks for any help!

my config

    StaticI18n.processDir(paths.tempHandlebars, {
      locale : 'en',
      outputDefault: 'index_en.html', // just hardcoded
      outputOther: '__lng__/index___lng__.html', // doesn't work
      localesPath : paths.locales,
      outputDir  : paths.tempI18n,
      locales: localeNames
    })
@danhper
Copy link
Member

danhper commented Nov 25, 2020

Hi,
I just pushed a new version which should allow you to do this. You can now use __basename__ in the filename, which will strip the extension.
In your case, the following should now work:

static-i18n -l en -i en -i ja --output-default '__basename_____lng__.html' --output-other '__basename_____lng__.html' /path/to/data

You should of course also be able to do it programmatically, as you were doing.
Please let me know if that works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants