question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Timeline: Localization sv_SE, nb_NO with warning

See original GitHub issue

Describe 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:

  1. Copy paste timeline example from PF showcase
  2. Put locale=“sv_SE” or locale=“nb_NO”

Expectation

  1. No warning in the console
  2. 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.
  3. 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:closed
  • Created 3 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sasynkamilcommented, Feb 16, 2021

@melloware sure; I attached to #6995 cs (czech) and I will ask my colleagues for sv and nb.

0reactions
mellowarecommented, Feb 16, 2021

Excellent thank you!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found