Skip to content

Internationalization #6

@faizanabidnaqvi

Description

@faizanabidnaqvi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions