can they help with multi-languages (I read a previous message in this forum that seemed to assume that contexes can be used for multi-language)
Hello MadMage,
Did you took http://svn.modxcms.com/docs/display/revolution/Internationalization" target="_blank" rel="nofollow">a look at lexicons?
It doesn’t seem to fit the requirement of a multi-language CONTENT: lexicons seems to be more related to snippets/plugins/backend translations.
Since lexicon entries are indexed by key, the only way to use this feature for multi-language content is to have a different key for each webpage, but website content pages are not supposed to be in lexicons, but in resources. Am I right?
(snip)
- How is the URL written for each different language? Is it the same URL? If so, how do users get straight to the FR content? Or the ES content? If it’s subdomains, how is that rewritten or setup? This is usually best solved by having subfolders; ie, mysite.com/en, mysite.com/fr. Which would lend to doing separate Resources - not one Resource.
- In your method, how would Template Variables, Chunks, Snippets, and more, be translated? What about Chunks nested in a Snippet nested in a TV? How would the language selection persist? Would TV edits need to be i18n aware? Would all snippets need i18n support? This adds a _lot_ of overhead and development to 3rd party extras.
So far we’ve decided on the string-based i18n solution, which states that you would do your i18n editing via Lexicon Topics (or collections of Lexicon Entries, rather), and then plug the Lexicon Tags into your resources. Then you can load the language however you want - via subdomain or folder - via a TV, snippet or plugin. You decide the method. This method allowed the least resistance, as it wont cause URL conflicts, will avoid multi-lang editing issues for TVs/Chunks/Snippets and nested tags, and solves the 3rd party extras problem.
We’re open to other ideas, but the route we’e chosen seems to have the least problems.
Right; it should be a choice - but making i18n Resources *a part of the core* means that that presentation is predetermined by the core, rather than the user’s implementation.
Ok, you are right with the URL, although cookies can be useful here: a resource is a webpage content, that means that if I am looking for a webpage that is about the moon, I want a webpage about the moon, the language is just a matter of presenting that content. The presentation should be a choice of the user.
Right; Resources are linked to TVs and Chunks; therefore, TVs would need to be i18n-aware, and so would Chunks (you’d need to have separate Chunk data stored for each language.
I do not know exactly how this work in other environments, but this seems to me to be related to something else, rather than multi-language content: pieces of software (snippets, TV, etc.) that need a translation of their textual messages. For this, I think that the lexicon stuff is the best choice (that is a variant of the well-known "gettext" solution).
However, I am talking about multi-language resources, rather than snippets, TV, etc.
Whatever you want; you can put all your articles in one topic, or per-article. Up to you.
I am not sure to have understood how you propose to do the multi-language content. What should be Lexicon Topics in my case? If I have 100 articles in one language, do you propose to have 100 lexicon topics or 100 lexicon tags or...?
Whatever you want; you can put all your articles in one topic, or per-article. Up to you.
I am not sure to have understood how you propose to do the multi-language content. What should be Lexicon Topics in my case? If I have 100 articles in one language, do you propose to have 100 lexicon topics or 100 lexicon tags or...?
Just an idea: How about a plugin that creates resources between different language context? Having each resource in a context, one can use the full power of resources (including independent aliases). The only issue I see is crosslinking to the same resource in an other context, but that could be handled by the plugin as well.
When a new resource is created or published in the main lang context, it could duplicate and place it unpublished into each language context. The administrator of each context would then see a new document that he has to translate and publish.
I am not sure what event would be suitable. Maybe OnDocPublished?
Is there OnDocCreate?
Additionally it could create a reference id to to the original resource (id in a tv) for cross-links between context. i.e. find document with origin "xy" in context "de"
OnContextCreate it could duplicate all resources from the main context, marked as unpublished and copy it to the new created context.
What do you think?