pagekit icon indicating copy to clipboard operation
pagekit copied to clipboard

Feature Request: Multilingual

Open PatrickPoney opened this issue 11 years ago • 93 comments

Making pagekit natively multilingual would be great.

Eventually, setting up a dedicated language manager extension would be interesting so it would give us the possibility to manage translatable content.

Also if do not need it, we could remove the extension and fallback to a monolingual site.

PatrickPoney avatar Aug 04 '14 14:08 PatrickPoney

Yes, multilingual ist a important feature in these days, also for smaller sites.

cbeier avatar Aug 05 '14 05:08 cbeier

Meanwhile, it is possible to create a language file for themes ? I tried " ./pagekit theme:translate mytheme " but : [InvalidArgumentException] Command "theme:translate" is not defined.

tups avatar Aug 05 '14 19:08 tups

I agree making pagekit natively multilingual is essential. It would be an extra reason to replace Wordpress by Pagekit.

tastymousehub avatar Aug 07 '14 08:08 tastymousehub

+1

MacWordPress avatar Aug 08 '14 16:08 MacWordPress

I'll take a look at the code and see if it is easily implemented. I'd like this feature, too.

chrispecoraro avatar Aug 10 '14 09:08 chrispecoraro

Would be really neat thing to be integrated. Without this, CMS'es are more like "US ONLY" thing for me.

So I +1 for this :)

huglester avatar Aug 12 '14 23:08 huglester

A CMS without multilanguage support is not a CMS.

markushausammann avatar Aug 19 '14 09:08 markushausammann

I'm taking a look at what would be required to make this happen. Is anybody else working on this? I'm not familiar with Symfony, but I use Laravel so it's shouldn't be too bad. Should we open up a new branch for this?

chrispecoraro avatar Aug 19 '14 19:08 chrispecoraro

To make this happen, several things need to happen:

Visitor side:

  • The locale (buttons, controls, etc) should switch for the visitor based on the language settings.
  • The content should be loaded into the correct language, based on the browser settings.

CMS side:

  • Creating versions of the post/articles/pages in another language should be possible.
  • There should be a fallback language.

chrispecoraro avatar Aug 20 '14 21:08 chrispecoraro

User friendly language negotiation:

  • check client language and serve content automatically in that language if available
  • if client language can't be detected or is not available, serve fallback language (configurable)
  • let user always select another language (overrides automatic detection) and permanently store it in DB for registered users, in cookie for guests, nothing is more annoying than a site that forgets what language I chose.

markushausammann avatar Aug 21 '14 07:08 markushausammann

Markus,

I agree, the only correction is that the client language/locale list is an array:

  • check client language(s) and serve content automatically in that language if available

Now, let me figure out what type of effort it would be. Do you have any tips? I'm new with Symfony, but not with PHP so I'll just start hacking into my fork.

chrispecoraro avatar Aug 21 '14 07:08 chrispecoraro

Storing of translations:

  • choose adapter wisely, you might need/want to provide online translation tools for crowd sourced CMS translations, handle plurals, etc.
  • break project down in to translation domains that are handled independently from each other (even if that means duplicate translations) e. g. cms-public-end, cms-admin-end
  • provide translations interface for plugin developers so they can hook into the infrastructure

markushausammann avatar Aug 21 '14 07:08 markushausammann

Chris, I'm using Symfony very rarely but I'm sure the translation infrastructure isn't very different from other frameworks. Personally I prefer using the gettext adapter.

Introducing i18n / translatability into a whole CMS is not a small task. Subtasks IMO are:

  • language negotiation (pretty easy, probably just something like a controller plugin)
  • language switcher (GUI, pretty easy, one typical mistake is to translate the selectable languages with the rest of the page which is BS, any language in a language switcher should always stay in that language, English, Deutsch, Italiano, etc. otherwise I might need to look for my language in a language I don't understand at all.)
  • translation adapter (hard choise and lots of work because you basically have to touch every single language string in the whole software, this will give you a good idea about the quality of your DI infrastructure and code readability, it will also force you to use sprintf in case you find stuff like $text . ' - and - ' . $anotherText in your code.
  • translatability of text stored in DB these are CMS content texts and I guess also a lot of other texts used in the GUI. Here it's important to create an infrastructure that centralizes all translations into one table so lookups can be optimized.

That's all I can think of at the moment. Just a brainstorm because I like the idea of pagekit and I have some experience with translating large infrastructures.

markushausammann avatar Aug 21 '14 07:08 markushausammann

Markus,

I agree that it is not a small task. I want to tackle one subtask, if possible. I just need to find out where to start.

The translation adapter is already in the code from what I can see, although I've created a issue regarding date formatting fallback.

chrispecoraro avatar Aug 21 '14 12:08 chrispecoraro

I can't understand this feature request...

On pagekit already exist localization and content are translatable using what mark said "gettext", using .po files which exist many po editor like poedit or online https://localise.biz/free/poedit

the function name is _() and there is @trans() function for view files.

Which part of pagekit should be translatable?

Content of pages and blogs?

Not sure if this is required by cms core, also WordPress does not support a bilingual or multilingual blog out-of-the-box. There are however Plugins developed by the WordPress community which will allow you to create a multilingual blog easily.

This can be the same for pagekit.

Maybe there is something other that is not translatable which I missing?

kamov avatar Sep 02 '14 07:09 kamov

Yes, I want translated content and I think it is a mayor shortcoming of Wordpress that it is not native multi-lingual. I don't use it any longer for multi-language sites. The plugins are either not user-friendly or they make the pages load slow. If Pagekit gets multi-lingual and gets post ordering in the blog I intend to stop using Wordpress.

tastymousehub avatar Sep 02 '14 07:09 tastymousehub

It should also do browser locale detection and serve up the proper language of the content. To do this, we would need to add a locale code field for the posts.

chrispecoraro avatar Sep 02 '14 07:09 chrispecoraro

In our experience, yes it is good to detect users language, but for example in my country 60% users use browser in english, but language is lithuanian. so we separate language by slug.

ALso in-core multi-language would be good because of search modules or something like this. We currently are using PyroCMS with custom multi-lang support.

For us multi-language is not only the translated cms buttons or something. We need to wrtie news for example in differnet languages, pages are in different languge, then search involves searches only in specific language etc...

Thanks Jaroslav

huglester avatar Sep 02 '14 08:09 huglester

@tastymousehub I understand now.

I found this topic on roadmap here: http://www.pagekit.com/roadmap

They seem integrate this feature but only in Future, after releasing 1.0.0 in first quartar of 2015.

For now maybe someone will prepare an extension for this.

I agree with mark who suggest how to handle this:

  1. check client language and serve content automatically in that language if available
  2. if client language can't be detected or is not available, serve fallback language (configurable)
  3. let user always select another language (overrides automatic detection) and permanently store it in DB for registered users, in cookie for guests

kamov avatar Sep 04 '14 09:09 kamov

Guys, you really need to prioritize multi-language functionality. Like nearly all other platforms, you've left it as an afterthought, and it's gonna get messy. While I'm here, I also want to share that your URL structure needs to steer clear of filler words like "page," "post," "category," etc. These are really a nuisance for SEOs and site owners who want to migrate to a new platform but retain the organic ranking they've worked so hard and spent so much money to achieve. I wouldn't even look at yet another CMS that doesn't support custom URLs and multi-language functionality.

88kbbq avatar Jan 28 '15 09:01 88kbbq

:+1:

fabianmarz avatar Feb 25 '15 08:02 fabianmarz

:+1:

lenovouser avatar Feb 25 '15 15:02 lenovouser

:+1:

rbarilani avatar Feb 28 '15 23:02 rbarilani

@88kbbq you are right! :+1

vizo avatar Aug 23 '15 22:08 vizo

We released the Pagekit Beta today. I close this issue because the code base completely changed. Please open a new issue if it still exists.

saschadube avatar Sep 10 '15 15:09 saschadube

Great news Sascha, I'll check it out.

Cheers!

Kevin

On Thu, Sep 10, 2015 at 11:47 PM, Sascha [email protected] wrote:

We released the Pagekit Beta http://www.pagekit.com/blog/2015/09/10/pagekit-beta-released today. I close this issue because the code base completely changed. Please open a new issue if it still exists.

— Reply to this email directly or view it on GitHub https://github.com/pagekit/pagekit/issues/173#issuecomment-139287342.

88kbbq avatar Sep 10 '15 19:09 88kbbq

But does the new pagekit support multilingual sites?

markushausammann avatar Sep 11 '15 08:09 markushausammann

No, sorry, this is on the roadmap.

saschadube avatar Sep 11 '15 11:09 saschadube

Disappointed.

Sent from my iPhone

On 2015年9月11日, at 19:42, Sascha [email protected] wrote:

Sorry, this is on the roadmap.

— Reply to this email directly or view it on GitHub.

88kbbq avatar Sep 11 '15 12:09 88kbbq

+1 must-have IMHO

pepperstreet avatar Sep 13 '15 22:09 pepperstreet