这个铁ature is available starting from the Pro plan and above. Also available for purchase on other paid plans.
This is a beta app that runs in the Contentful Editor. If you're looking for a current app that works from Lokalise,请参考相应的文章.
Main capabilities of the native app:
- Import and export content between Contentful and Lokalise.
- Works with all RichText capabilities.
- Works with pages that contain multiple layers of referenced entries.
- Could be separately installed in different spaces and any environments.
Install the app from Contentful marketplace:
https://www.contentful.com/marketplace/app/lokalise/
Index
Installation
Prerequisites
You'll need aSoftware localizationproject on Lokalise with the same locales you have in the Contentful space (learn more about locales in Contentful):
Base languageon Lokalise should be the same as theDefault localeon Contentful.
Please ensure that you have all locales added and they have the same ISO codes in both Contentful and Lokalise. Refer to theLanguage settingsarticle to learn about custom languages if the default list of locales does not precisely match your locales on Contentful.
Installing the app
To install the app, open Contentful, navigate toApps, selectMarketplace, chooseTranslation and Localizationcategory, findLokalise, and then pressInstall:
Next, select an environment where you want to install the app. Lokalise app could work with any environment and the app could only be installed to one environment:
Tip:If you can't connect to the Lokalise, check the notification — some browsers may block the authorization popup.
Select a Lokalise project and related content types and clickInstallin the top right corner:
Review the default settings and clickSavein the top right corner:
Exporting entries from Contentful to Lokalise
TheLokalisesection will appear in the sidebar forEntriesof content types that you have selected during installation:
ClickExport content to Lokaliseto export the default locale value:
Translating exported entries on Lokalise
Now proceed to your Lokalise project and open editor. You'll see that the corresponding Lokalisetagshave been linked to the inserted keys:
The following tags are added automatically:
-
contentful-native
— refers to the app itself -
[Page] ...
— the title of the entry that has been initially exported to Lokalise.
The key names are generated using Entry ID and Field ID separated with the:
delimiter.
Tip:sort keys byFirst addedto see fields appear in the same order as they appear within the Contentful editor.
Importing translations from Lokalise to Contentful
Translations can be imported from the Lokalise sidebar section. You can import one or multiple locales:
You'll see a dialogue with a preview of translations to be imported. ClickImport from Lokaliseto update translations in Contentful:
How composable pages with referenced entries are exported
The Lokalise app exports the entry where export has been run initially along with all the referenced entries from this page, whether they were references in separate fields or from RichText content.
You can preview what entries will be exported in the export dialog:
Unchecking a referenced entry means that all entries below won't be exported.
All selections are saved per content type, so once you have configured an export you won't need to re-configure it in subsequent exports for the same content types.
除了ent Lokalise应用遵循所有相关条目ries that are separate pages. The app considers an entry a separate page if this page has a field withslug
ID:
Fields from the referenced entries would be exported into separate keys and the key name would contain the ID of the referenced entry. A connection between exported and referenced entries is maintained via tags -- referenced entries would have a tag with the title of the exported entry.
Fields that can't be exported to Lokalise
Not all fields can be exported to Lokalise. Such fields will be marked with greyed-out checkboxes and you'll see tooltips with explanations. For example, check theISBNfield in the screenshot below:
Here are the main reasons why fields or entries might not be exported to Lokalise:
-
A field doesn't have localization enabled. Non-localized fields cannot be imported to Lokalise as Contentful won't accept translations for such fields.Please refer to the section belowto learn how to enable localization for a field.
-
A field doesn't have a text-based field type. Only the following field types are exported to Lokalise:
-
Symbol — short text
-
Text — long text field
-
RichText — formatted text
-
-
An entry is archived. Translations for archived entries cannot be updated.
Enabling localization for a field
To enable localization for a field, navigate to theData modeltab, click on the name of the data model, and then clickEditfor a field you want to configure. Then check theEnable localization of this fieldsetting:
Known limitations
-
Exporting and importing can be performed only on Contentful (not on Lokalise).
-
Exporting to Lokalise is currently limited to the default locale. The ability to export previously translated content is expected to be added later.
-
It's not possible to modify translations for the default locale on Lokalise and then export to Contentful. For example, if your default locale is set to English, you can't modify English translations on Lokalise and then push these changes to Contentful.
-
Automated export and import are not supported.
-
Only field-based localization is supported.
-
Images and other assets, and their fields cannot be localized via Lokalise.
-
Fields containing Markdown markup will be imported as plain text, without creating Lokalise placeholders.
-
Lokalise automationsare always enabled when exporting from Contentful to Lokalise via the native app.