plotly / plotly/plotly.js

Locale dictionary not being included even though they exist

未关闭
#7,450 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug P1
主要语言
JavaScript
星标
18.3k
派生
2k
平均合并
2 天 12 小时
30 天内合并 PR
28

描述

I have included several of the Plotly Locales in my project before (es, pt-br, zh-ch, ar) and now I am trying to include Norwegian (no) but the translations dictionary is not working when setting "no" as the locale. The dictionary is returning an empty object.
The formatting is working and the dates and times are being translated to norwegian as they should be, but the modebar buttons are remaining english even though the dictionary translations are included in the plotly.js/lib/locales/no.js file.

I tested this with a couple of other languages to check that I wasn't missing something and the same problem occurs if I try to use romanian (ro) - the formatting is correct and present, but the dictionary translations are not working even though they are included in the file.

Image shows the plotly config including several languages, see that the Spanish (es) locale shows the occupied dictionary translations as it should, but the Norwegian (no) locale shows an empty object for the dictionary, however, includes the formats.
Image

Summary:
Norwegian locale dictionary is not working (returning empty objects when importing) even though the translations are included in plotly.js/lib/locales/no.js. Same problem occurs with Romanian - possibly others.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 lib/locales/no.js 开始,将其导出的字典和格式与正常工作的 es locale 进行比较。使用 no 和 ro locale 重现问题,然后追踪 locale 字典是如何导入或注册的。完成的标准是 no 和 ro 字典已填充,并且其 modebar 翻译已应用,同时格式保持正确。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
internationalization
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。