tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

More in-depth tutorial on Internationalization?

Open visto9259 opened this issue 11 months ago • 2 comments

The Internationalization section of the tutorial is very light. It provides an overview that it is possible to add other languages but it does not provide a real example of adding another locale to the application.

Should there be a more in-depth tutorial on this? Should it be part of this tutorial? Do we know of a tutorial on this that could be referenced (assuming that it would be ok to reference a 3rd-party tutorial)?

I am just raising this as an issue so that we have a trace of the decision.

visto9259 avatar Mar 22 '24 01:03 visto9259

…but it does not provide a real example of adding another locale to the application.

Correct because the problem is that the component laminas-i18n or an satellite package does not provide a solution for this. For a laminas-mvc based application this could be a listener.

The documentation of Mezzio contains two descriptions for this problem:

  • https://docs.mezzio.dev/mezzio/v3/cookbook/setting-locale-depending-routing-parameter/
  • https://docs.mezzio.dev/mezzio/v3/cookbook/setting-locale-without-routing-parameter/

But in my opinion, this is not helpful, as the middleware or listener should be provided by the related components. Ready to use for the end user and not by copying and pasting from the documentation. Therefore, a solution should first be created in the component, then the usage can be explained in the tutorials.

…assuming that it would be ok to reference a 3rd-party tutorial…

We can create a section "Community Resources" and add 3rd-party tutorials there. (Example) But before this can be added, we need an automatic link checker, otherwise we will produce dead links in the future.

froschdesign avatar Mar 22 '24 07:03 froschdesign

I agree that the biggest issue that I saw with having a more detailed tutorial is the mechanism to switch locales. There is nothing in MVC components to provide a "off-the-shelf" mechanism to do that. In my app, the locale is part of the user profile. Only public pages use locale via routing. I also used cookies to store the selected locale. All done via listeners. So for now, I suggest that we keep it as is. The poedit screenshot is outdated but that's a minor issue.

visto9259 avatar Mar 22 '24 13:03 visto9259