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

Internationalization #6

Open
faizanabidnaqvi opened this issue Apr 9, 2019 · 0 comments
Open

Internationalization #6

faizanabidnaqvi opened this issue Apr 9, 2019 · 0 comments

Comments

@faizanabidnaqvi
Copy link

Hi there!

Thank you for this great work! I am trying to create a CMS that has English and Norwegian as base languages. I followed the guide here:
https://www.cannercms.com/docs/guides-internationalization

In this project, there was no canner.server.js, so I created one and included the following as test code:

//canner.server.js
exports.cms.i18nMessages = {
  en: {
    'hours_label': 'Opening Hours'
  },
  no: {
    'hours_label': 'Opening Hours Norwegian'
  }
}

Then in one of my schema, I added:
<string keyName="hours" title="${hours_label}"/>

When I run, it doesn't render the text; instead, it just shows as hours_label.

I also tried react-intl. But react-intl somehow does not work for components. It works on higher level such as in dashboard.js. For components, the function {this.props.intl.formatMessage(messageObj)} works but does not appear localized based on selected language. It doesn't seem to get the IntlProvider data.

I'll be thankful if you can set me in the right direction for internationalization.

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

1 participant