NativeScript / NativeScript/plugins
[android][Localize] Values-(default language) not generated
未关闭
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 206
- 派生
- 123
- 平均合并
- 2 天 1 小时
- 30 天内合并 PR
- 1
描述
Hi @NathanWalker,
There is little issue with the localize plugin, the default language not generated in his own folder because of this rule since it is the default language the hook generate the strings for res/values/strings.xml only, I think it should generate also res/values-en/strings.xml.
I suggest this :
run() {
this.dataProvider.getLanguages().forEach((languageI18nEntries, language) => {
// ADD THIS
if(language === this.dataProvider.getDefaultLanguage()) {
this.createLanguageResourcesFiles(language, false, languageI18nEntries);
}
this.createLanguageResourcesFiles(language, language === this.dataProvider.getDefaultLanguage(), languageI18nEntries);
});
if (fs.existsSync(this.appResourcesDirectoryPath) && fs.statSync(this.appResourcesDirectoryPath).isDirectory()) {
this.cleanObsoleteResourcesFiles(this.appResourcesDirectoryPath, this.dataProvider.getLanguages());
}
return this;
}
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 packages/localize/hooks/converter.ts 中第 105 行附近的规则以及 issue 中显示的 run() 入口点开始。跟踪默认语言如何传递给 createLanguageResourcesFiles,并验证生成的 Android 资源。完成的标准是默认语言同时生成 res/values/strings.xml 和其语言专用的 res/values-en/strings.xml,且不破坏 cleanup。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- localization, mobile
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 38/100