Timeline: Localization sv_SE, nb_NO with warning
See original GitHub issueDescribe the defect
Permanent warning when timeline is loaded: timeline.js.xhtml?ln=primefaces&v=8.0:52 WARNING: options.locales['nb_NO'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization
This is similar issue as Timeline: Localization pt_BR with warning
Reproducer Set p:timeline property to: locale=“sv_SE” or locale=“nb_NO”
Environment:
- PF Version: 8.0
- MyFaces 2.3.6
- Affected browsers: ALL
To Reproduce Steps to reproduce the behavior:
- Copy paste timeline example from PF showcase
- Put locale=“sv_SE” or locale=“nb_NO”
Expectation
- No warning in the console
- I can see that PF documentation (since version 8) contains information to add momentum js (/moment.js and e.g. locale/es.js) to localize timeline. Originaly, localization was made by
PrimeFaces.locales
[PF Wiki ] (https://github.com/primefaces/primefaces/wiki/Locales) (we are using this way since PF 4). Is this way deprecated for timelne? If yes, there is no information in migration guide about this. - Maybe it would be good to add to the doc: What is the preferable way of including moment.js into project? Schould be downloaded separately or used that one is included in PF jars already (how)? Link to download moment and locales: CDNJS
Code snippets test.xhtml
<h:head>
<title>PrimeFaces Test</title>
<h:outputScript name="js/primefaces_localization.js" />
<f:facet name="first">
<h:outputScript name="js/moment.min.js" />
<h:outputScript name="js/moment/locale/nb.js" />
<h:outputScript name="js/moment/locale/sv.js" />
</f:facet>
</h:head>
<h:body>
primefaces_localization.js
PrimeFaces.locales['sv_SE'] = {
closeText: 'Stäng',
prevText: 'Föregående',
nextText: 'Nästa',
monthNames: ['januari', 'februari'
...
PrimeFaces.locales['nb_NO'] = {
closeText: 'Lukk',
prevText: 'Forrige', nextText: 'Neste',
monthNames: ['januar', 'februar', 'mars',
...
nb.js, sv.js, moment.min.js downloaded from CDNJS
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
New Balance Nationals Outdoor
Home, Photos · News · Videos · Info/Results · NBNO Meet Info · Schedule · Results · Records · NB Flyer ... NBNO...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@melloware sure; I attached to #6995 cs (czech) and I will ask my colleagues for sv and nb.
Excellent thank you!