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

Got a error if columns.locale is zh-CN #61

Closed
zqjimlove opened this issue May 27, 2022 · 1 comment
Closed

Got a error if columns.locale is zh-CN #61

zqjimlove opened this issue May 27, 2022 · 1 comment

Comments

@zqjimlove
Copy link

At least a duplicated value in files JSON object was detected

{"columns":[{"locale":"en","label":"en"},{"locale":"zh-CN","label":"zh-CN"}],"files":{"en":"/translations/en/translation.json","zh-CN":"/translations/zh-CN/translation.json"},"filename":"translation","outputDir":"/Users/hujin/Projects/socialFi/alienswap-app/temp"}
@jy95
Copy link
Owner

jy95 commented May 27, 2022

Hello,

Thanks for the report - it seems thrown by this line :

  if (uniq(Object.values(files)).length !== entries.length) {
    return new Error(
      `At least a duplicated value in files JSON object was detected`
    );
  }

Obviously, some stuff happened that made that condition true whereas it shouldn't
When I tried to reproduced it, I saw that yargs duplicated your "zh-CN" entry :

{
  EN: 'D:\\TEMP\\TEMP\\tests-for-export-xlsx\\correct\\fr.json',
  'zh-CN': 'D:\\TEMP\\TEMP\\tests-for-export-xlsx\\correct\\de.json',
  zhCN: 'D:\\TEMP\\TEMP\\tests-for-export-xlsx\\correct\\de.json'
}

Apparently, by default, yargs has a setting in his inner parser called camel-case expansion set to true that caused that issue.
@zqjimlove I created a fix : can you check if your issue is solved with v1.6.7 please ? (Reopen the issue if it isn't the case)

jy95 added a commit that referenced this issue May 27, 2022
jy95 added a commit that referenced this issue May 27, 2022
@jy95 jy95 closed this as completed May 27, 2022
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