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

_locales folder names should have underscore, not dash. #1632

Closed
losnappas opened this issue Jun 16, 2019 · 3 comments · Fixed by #1637
Closed

_locales folder names should have underscore, not dash. #1632

losnappas opened this issue Jun 16, 2019 · 3 comments · Fixed by #1637
Projects

Comments

@losnappas
Copy link

Is this a feature request or a bug?

Bug

What is the current behavior?

web-ext build an extension with a localization for en-US throws errors. The folder name is supposed to be "en_US" but web-ext complains that it's not "en-US".

What is the expected or desired behavior?

Should not throw errors.

Version information (for bug reports)

  • Firefox version: 67
  • Your OS and version: ubuntu 19.04
  • Paste the output of these commands:
node --version && npm --version && web-ext --version

$ node --version && npm --version && web-ext --version
v10.15.2
6.9.0
3.0.0

@Rob--W
Copy link
Member

Rob--W commented Jun 20, 2019

Could you provide an example of a project that throws the reported error? Did you possibly put an invalid value in the default_locale field in manifest.json?

@losnappas
Copy link
Author

{
  "description": "test",
  "manifest_version": 2,
  "name": "test",
  "version": "0.3",
  "homepage_url": "https://www.exapmle.org",
  "default_locale": "en-US",

  "browser_action": {
	  "default_title": "test"
  },

 "permissions": [
    "activeTab",
    "menus",
    "<all_urls>"
  ]
}

then I have _locales/en_US/messages.json

From the internationalization page, I understood that this was how it is supposed to be. Is en-US an invalid value?

Note that if the subtag includes a basic language plus a regional variant, then the language and variant are conventionally separated using a hyphen: for example, "en-US". However, in the directories under _locales, the separator must be an underscore: "en_US".

@Rob--W
Copy link
Member

Rob--W commented Jun 25, 2019

Thanks for the example. The directories must use underscores, but the default_locale field can apparently contain hyphens. I've submitted a PR to address the issue.

@rpl rpl closed this as completed in #1637 Jun 25, 2019
@rpl rpl added this to To do in 3.1.0 via automation Jul 1, 2019
@rpl rpl moved this from To do to Done in 3.1.0 Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
3.1.0
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants