Skip to content

Conversation

@pwizla
Copy link
Collaborator

@pwizla pwizla commented Apr 8, 2021

What does it do?

  • Addition of a new link in Development > Strapi plugins
  • Addition of a whole new "Internationalization" document that:
    • quickly introduces i18n
    • and describes in detail how to use the i18n plugin
      * with the Content API
      * and with the GraphQL plugin
  • Update sidebar for easier access to Strapi plugins
  • Update some parts of Content API and GraphQL plugin docs so that readers are aware of i18n plugin docs

pwizla and others added 22 commits April 1, 2021 19:32
* Better examples for GET and POST requests
* "Updating an entry" content is no longer a callout
* Add some in-code comments, questions and todos
* Various linting updates
This will be transferred to another PR.
Copy link
Member

@Convly Convly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, it looks really cool overall, I'll play a bit more with it tomorrow 🙂

Copy link
Collaborator

@meganelacheny meganelacheny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀
This is a really nice documentation, great job @pwizla ! 👏

Co-authored-by: meganelacheny <megane.lacheny@strapi.io>
@pwizla pwizla requested a review from alexandrebodin April 16, 2021 08:15
Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One precision but the rest looks good to me :)

Copy link

@lauriejim lauriejim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM good job 🚀

**Example request**
```js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vuepress uses prismjs and this is their list of supported codes: https://prismjs.com/#supported-languages

Copy link
Collaborator Author

@pwizla pwizla Apr 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip, @derrickmehaffy ! Honestly I was not too sure about what to use when I was writing, and re-used what we did for Content API.

But looking at the list you shared, http seems more appropriate.

I changed it here and I'll create another PR for other similar code blocks in the repo.

When creating a localization for existing localized entries, the body of the POST request can only accept localized fields.
::: tip TIP
The Content-Type should have the [`createlocalization` permission](http://localhost:8080/documentation/user-docs/latest/users-roles-permissions/configuring-administrator-roles.md#collection-and-single-types) enabled, otherwise the POST request will return a `403: Forbidden` status.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used a localhost:8080 address here :P

Copy link
Collaborator Author

@pwizla pwizla Apr 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice catch! 😅 Thanks @derrickmehaffy ! fixed it

@derrickmehaffy
Copy link
Member

It shows my comments on the js code for syntax highlighting as required changes, they aren't just comments.

@derrickmehaffy
Copy link
Member

This pull request has been mentioned on Strapi Community Forum. There might be relevant details there:

https://forum.strapi.io/t/content-internationalization-i18n-beta-is-live/3892/50

@derrickmehaffy
Copy link
Member

This pull request has been mentioned on Strapi Community Forum. There might be relevant details there:

https://forum.strapi.io/t/content-internationalization-i18n-beta-is-live/3892/51

A `STRAPI_PLUGIN_I18N_INIT_LOCALE_CODE` [environment variable](/developer-docs/latest/setup-deployment-guides/configurations.md#environment-variables) can be configured to set the initialization locale for your environment. The value used for this variable should be a string (see [full list of available locales](https://github.com/strapi/strapi/blob/features/i18n/packages/strapi-plugin-i18n/constants/iso-locales.json)).

The value used for this variable should be a string (see [full list of available locales](https://github.com/strapi/strapi/blob/features/i18n/packages/strapi-plugin-i18n/constants/iso-locales.json)).
This is useful when a Strapi app is deployed in production, with the i18n plugin installed and enabled on your content types for the first time. On a fresh i18n plugin installation, `'en'` is the default locale. So if the database does not contain any locale, and no `STRAPI_PLUGIN_I18N_INIT_LOCALE_CODE` is set for the environment, all the existing content saved in the database will be migrated with the locale defined as `'en'`. But if the `STRAPI_PLUGIN_I18N_INIT_LOCALE_CODE` is defined, then the content will be migrated and set up with this locale. This will prevent from manually updating the locale for every existing content entry.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of all the existing content I would have said that the content of the content types with i18n enabled will be auto migrated to the locale. The rest looks good to me!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alexandrebodin ! I've just updated it :-)

Copy link
Member

@derrickmehaffy derrickmehaffy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@pwizla pwizla merged commit 8ca0420 into main Apr 21, 2021
@pwizla pwizla deleted the dev/i18n branch April 21, 2021 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flag: merge pending release Pending Strapi Release source: Dev Docs PRs/issues targeting the Developer Docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants