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

Multi-language setup support #768

Closed
JiaHenry opened this issue Sep 22, 2016 · 10 comments
Closed

Multi-language setup support #768

JiaHenry opened this issue Sep 22, 2016 · 10 comments

Comments

@JiaHenry
Copy link

  • Version: 7.4.0
  • Target: Windows

This is a question not an issue.
I want make windows setup (NSIS) files of our app for multi-language (English, Chinese & Japanese).

The files structure is as following:
/myapp
/build
package.json
/en
/cn
/jp

What I do now is, use one package.json for build, and for each language

  1. Rename the source folder to app;
  2. Run build script
  3. Rename the output dist, and rename the source folder to original name.

Use en for example: it's
/en -> /app => build ... => /dist -> /dist-en, /app -> /en

Here some my question: if it's possible to support those steps with options or additional config item.

  1. For options, the script like "build -w --x64 --build.directories.app=en --build.nsis.language=1033"
  2. For config, which like
{
    "apps": [
        {
            "app": "en",
            "language": 1033
        },
        {
            "app": "jp",
            "language": 1041
        },
        {
            "app": "cn",
            "language": 2052
        }
    ]
}

Also I want to know how to make the build.nsis.language work as expected, I'm still get an English version even I set it to 1041 (setup with Japanese is expected)
"nsis": { "oneClick": false, "allowElevation": false, "language": 1041 }

Thanks.

@develar
Copy link
Member

develar commented Sep 22, 2016

if it's possible to support those steps with options or additional config item

Use --extraMetadata CLI. --em.build.directories.app

@develar
Copy link
Member

develar commented Sep 22, 2016

I'm still get an English version even I set it to 1041 (setup with Japanese is expected)

language doesn't set language of installer. Please see #646 (comment) Japanese is supported — but your windows language should be set to Japanese as well.

@JiaHenry
Copy link
Author

Thanks for your quick reply.
I just made an test app base on our project and pushed it at [https://github.com/JiaHenry/myapp].
Now I made setup files by run node buildall.js

For your reply:

  1. From the document, the --extraMetadata is used for application package.json,what I want is inject build package.json.

--extraMetadata, --em Inject properties to application package.json

  1. I will give a try with the language, it looks not convenient if I want make multi setups on one machine.

BTW, how to add comment as a reply.

Thanks for your project and make my setup work easy :)

@develar
Copy link
Member

develar commented Sep 22, 2016

From the document, the --extraMetadata is used for application package.json,what I want is inject build package.json.

Doc is a little bit outdated — if you set root key build, it will be applied to development package.json. --em.build. But currently you cannot change directories layout — not supported. I will fix it.

UPDATE: fixed in 7.6.0

@develar
Copy link
Member

develar commented Sep 22, 2016

it looks not convenient if I want make multi setups on one machine.

Well... I suggest you to not build 3 different apps — but instead one app that can select language in the runtime using windows locale. It is how NSIS works — it can be changed, but sorry, I am not going to implement it (pull request will be accepted or may be custom script will help).

@JiaHenry
Copy link
Author

I tried with the NSIS setup on Windows 10 with different languages. And it looks that the setup file is support multi-UI, all pages shown with localization text except the 1st page which allow select install per-machine or per-user, it keeps showing in English.

@develar
Copy link
Member

develar commented Sep 23, 2016

it keeps showing in English.

Yes, as stated "Our custom strings are not translated, please file PR. This issue will be closed.".

Please file pull request. If you cannot, but it is important for you, well... I will try to fix.

@JiaHenry
Copy link
Author

Got it, I'll try again.

I made a mistake about the location of directories, it's not under build but at the same level. Could you please add similar code to support --em.directories like support --em.build? If support then I can use build with scripts instead of buildall.js I made:
build -w --x64 --em.directories.app=app/en --em.directories.output=dist_en
build -w --x64 --em.directories.app=app/cn --em.directories.output=dist_cn
build -w --x64 --em.directories.app=app/jp --em.directories.output=dist_jp

Thanks for your help.

@develar
Copy link
Member

develar commented Sep 23, 2016

I made a mistake about the location of directories, it's not under build but at the same level.

Yeah, sorry for confusion, fixed (will be published soon).

@dharders
Copy link

@JiaHenry you should also put your language id in double quotes (i.e. it expects a string).

i.e. Change
"language": 1041
to
"language": "1041"

Note:
This will only change the language for the file properties only (eg. Right-click setup.exe Properties->Details->Language = Japanese) and not the installer text, as develar suggested.

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

No branches or pull requests

3 participants