MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Jul 04, 2009, 04:44 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search via SMF
or Google:
modx forums
all of modxcms.com
web
MODxCMS.com
Forums
Help
Login
Register
News
:Donate to MODx:
Donations
MODx Community Forums
»
Add-ons, Extensions & Elements
»
Module, Plugin & Snippet Usage
»
[Snippet] Multi Lingual - One Stop Solution
Pages: [
1
]
Go Down
« Previous topic
Next topic »
Print
Author
Topic: [Snippet] Multi Lingual - One Stop Solution (Read 6733 times)
0 Members and 1 Guest are viewing this topic.
Djamoer
Emeritus
Posts: 1,495
No one can limit a man other than the man himself.
[Snippet] Multi Lingual - One Stop Solution
«
on:
Dec 11, 2005, 10:59 AM »
I created this snippets based on my solution. After looking for some simple solution in integrating Multi Lingual site with MODx, I came up with this solution, so if somebody able to improve it, feel free to modify it and posted it in here.
Special thanks to several people in this forum that helps me a lot in the progress of understandng MODx better and giving me a lot of better idea in bringing this whole Multi Lingual thing.
Thanks to Bravado for pointing me to the right direction.
This solution might lead to modifying several snippet such as NewsListing and etc to support this Multi Lingual site. I'm working on ChildDocumentMapper snippet right now, if somebody willing to do the newslisting snippet, it will be great!
Please read the comment on the code, hope that explains, if not, feel free to figure it out by the code, it's a really simple code, you don't need to be a PHP guru to understand it.
Note: 'domain.com - MultiLingual.snippet.modx.txt' is just the configuration file, you can duplicate this if you have several site running on the same installation.
Sample:
Code:
[!MultiLingual? &ML_action=`Localization` &ML_locale=`2`!]
[!MultiLingual? &ML_action=`LocalizationImage` &ML_locale=`wendy.jpg`!]
[!MultiLingual? &ML_action=`Translation` &ML_varname=`content`!]
[!MultiLingual? &ML_action=`ListLanguage` &ML_listlangchunktpl=`domain.com - MultiLingual ListLang`!]
Have fun!
Best regards,
Wendy Novianto
MultiLingual.snippet.modx.txt
(7.24 KB - downloaded 656 times.)
domain.com - MultiLingual.snippet.modx.txt
(2.18 KB - downloaded 598 times.)
«
Last Edit: Dec 11, 2005, 11:03 AM by wendy
»
Logged
Wendy Novianto (
DJAMOER Solution and Design
)
Search
|
Download Latest Release
|
General Support
About MODx
|
Documentation
|
Bugs/Wishlist
|
FORUM RULES
Djamoer
Emeritus
Posts: 1,495
No one can limit a man other than the man himself.
Re: [Snippet] Multi Lingual - One Stop Solution
«
Reply #1 on:
Dec 11, 2005, 08:39 PM »
Hi guys,
Anybody know how to use mod rewrite?
I'm looking for a way so that the mod rewrite will take 'domain.com/doc/lang_en', 'domain.com/doc/lang_en/', or 'domain.com/index.php?q=1/lang_en' into 'domain.com/doc/?lang=en' or 'domain.com/index.php?q=1&lang=en'.
I really want to eliminate the use of querystring displaying in user browser. If somebofy can helps with it, it will be really great.
Thanks
Regards,
Wendy Novianto
Logged
Wendy Novianto (
DJAMOER Solution and Design
)
Search
|
Download Latest Release
|
General Support
About MODx
|
Documentation
|
Bugs/Wishlist
|
FORUM RULES
sottwell
Documentation Team
Posts: 8,830
Re: [Snippet] Multi Lingual - One Stop Solution
«
Reply #2 on:
Dec 12, 2005, 02:23 AM »
I eliminated the query string issue by using a cookie; session can also be used, although that requires some hacking of the login snippet php files, besides timing out. There are pros and cons to all three methods.
Logged
sottwell.com has moved to a lovely Solaris 10 server!
Log in
username guest, password guestuser.
Templates are now becoming available at
http://sottwell.com/templates.html
Djamoer
Emeritus
Posts: 1,495
No one can limit a man other than the man himself.
Re: [Snippet] Multi Lingual - One Stop Solution
«
Reply #3 on:
Dec 13, 2005, 09:18 AM »
Thanks Susan, but do you have any experience with mod rewrite before? I'm thinking to avoid cookie if possible. I think mod rewrite might be one of the way to do this.
If somebody willing to give it a try, I will be glad to test the regular expression code for the mod rewrite in my site.
Thanks
Sincerelt,
Wendy Novianto
Logged
Wendy Novianto (
DJAMOER Solution and Design
)
Search
|
Download Latest Release
|
General Support
About MODx
|
Documentation
|
Bugs/Wishlist
|
FORUM RULES
rthrash
Foundation
Posts: 10,471
Re: [Snippet] Multi Lingual - One Stop Solution
«
Reply #4 on:
Dec 13, 2005, 09:47 AM »
mod_rewrite... what a often tricky beast!
Best resource I've found for it:
http://forum.modrewrite.com/
Given a few days, pretty much any challenge you face should be solvable!
Logged
MODx
is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you
help us help you
,
read the wiki
, and review snippet parameters even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @
Collabpad
work
productively.
work
intelligently.
work
together.
MODx
Current
|
Dev
|
SVN Root
|
JIRA (Bugs)
|
Confluence (Revolution Wiki)
|
Fisheye SVN Browser
sottwell
Documentation Team
Posts: 8,830
Re: [Snippet] Multi Lingual - One Stop Solution
«
Reply #5 on:
Dec 13, 2005, 10:01 AM »
Indeed, mod_rewrite is very tricky. It can depend on the server configuration, the server version, and the mod_rewrite module's version as well as how it was compiled. I have hesitated to rely on it for anything much beyond the basics for that reason. And, of course, if you're on a Windows/IIS server, you can pretty much forget it.
Logged
sottwell.com has moved to a lovely Solaris 10 server!
Log in
username guest, password guestuser.
Templates are now becoming available at
http://sottwell.com/templates.html
Djamoer
Emeritus
Posts: 1,495
No one can limit a man other than the man himself.
Re: [Snippet] Multi Lingual - One Stop Solution
«
Reply #6 on:
Dec 13, 2005, 11:53 PM »
Yep,
I have to agree to that. I'm depended heavily on mod rewrite right now, for me to be able to host several sites running on the same MODx installation. Sometimes it does crazy thing, such as when you clear the cache, and you visit the site with other domain, instead of the right domain, then MODx will cache the page with the given base url on the wrong domain, which means that I have to refresh the site, and go through each page one by one using the right domain, so that MODx will cache the right base url. Is there anything better to have mutli site capability in MODx, instead of using mod rewrite and overwrite the other domain to be directed to certain path?
Btw, I found weaknesses in this snippet approach of having Multi Lingual site. When you substitue [*#content*] with [!MultiLingual? &ML_action=`Translation` &ML_varname=`content`!], basically whatever inside the content variable will be written as is, it means that the snippets or other special tag from MODx will not be parsed and displayed correctly by MODx parser, instead it will display them as is.
I guess I still need to use the injection approach using plugin to tap into the default page variables, before they were parsed into the document.
WHat do you guys think about this approach?
Thanks
Logged
Wendy Novianto (
DJAMOER Solution and Design
)
Search
|
Download Latest Release
|
General Support
About MODx
|
Documentation
|
Bugs/Wishlist
|
FORUM RULES
dernier_recours
Member
Posts: 83
Re: [Snippet] Multi Lingual - One Stop Solution
«
Reply #7 on:
Jan 30, 2006, 10:24 AM »
Hello Wendy,
I'm not used to terms "Localization" and "Internationalization". All I want is to make a website in French and English. I'm not a programmer, but nevertheless I tried to understand this snippet, now for three hours, and still don't understand what it does and how should I begin with my site: make two sets of tree? duplicate each entry in the tree? And what do I do with this snippet?
Thanks
a lot
!
It would be great to make a tutorial for multilingual sites!
«
Last Edit: Jan 30, 2006, 10:37 AM by dernier_recours
»
Logged
at the edge of dawn,
you ask yourself if your shadow did follow you down
all night long
Djamoer
Emeritus
Posts: 1,495
No one can limit a man other than the man himself.
Re: [Snippet] Multi Lingual - One Stop Solution
«
Reply #8 on:
Jan 30, 2006, 10:35 AM »
Hi,
I think this solution is still not done yet. What this thing does is actually use Template Variables as the translation document, intead of duplicating the document tree just for adding another translation. But this approach won't work, if you have a snippet or chunk inside your content.
If you have a simple multi lingual website. You can use the direcotry structure in modx to do the translation, and provide a link to that translated docs. For more advanced use of multi lingual solution, you can try to search this forum. Susan (sottwell) have a good documentation and solution to achieve this.
Let me know what you want to do in detail, and we will help you to choose the best possible solution for you.
Sincerely,
Logged
Wendy Novianto (
DJAMOER Solution and Design
)
Search
|
Download Latest Release
|
General Support
About MODx
|
Documentation
|
Bugs/Wishlist
|
FORUM RULES
dernier_recours
Member
Posts: 83
Re: [Snippet] Multi Lingual - One Stop Solution
«
Reply #9 on:
Jan 30, 2006, 11:31 AM »
I went through some solutions proposed in the forum. I have to admit that this goes beyond my understanding. What I expect from a multilingual site is more or less what I found with the i18n module of Drupal (
http://drupal.org/project/i18n
). I read that a solution like Drupal's is under investigation:
http://modxcms.com/forums/index.php/topic,6.0.html
For now, my site will not contain lots of files. I will stick on duplicating the directories and use chunks in different languages. As it will become larger, I hope some of the members will know how to find better solution.
I really appreciate your help.
Logged
at the edge of dawn,
you ask yourself if your shadow did follow you down
all night long
Djamoer
Emeritus
Posts: 1,495
No one can limit a man other than the man himself.
Re: [Snippet] Multi Lingual - One Stop Solution
«
Reply #10 on:
Jan 30, 2006, 11:33 AM »
No Prob.
We'll work on this for sure. By the time we have the solution for this ready, we will put it up on our repository of plugins and snippets for sure.
Thanks for your understanding
Logged
Wendy Novianto (
DJAMOER Solution and Design
)
Search
|
Download Latest Release
|
General Support
About MODx
|
Documentation
|
Bugs/Wishlist
|
FORUM RULES
OncleBen31
Sr. Member
Posts: 283
I believe in MODx!
Re: [Snippet] Multi Lingual - One Stop Solution
«
Reply #11 on:
Nov 11, 2006, 02:40 AM »
I'm searching how to add internationalization and localization to MODx. This snippet seems to be very powerfull.
Why this snippet is not in the repository ? Is there an better way to do that ?
Logged
rthrash
Foundation
Posts: 10,471
Re: [Snippet] Multi Lingual - One Stop Solution
«
Reply #12 on:
Nov 11, 2006, 09:45 AM »
The release after 095 will introduce "contexts" into the core of MODx which will make for a huge degree of flexibility. Short response: "yes".
Logged
MODx
is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you
help us help you
,
read the wiki
, and review snippet parameters even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @
Collabpad
work
productively.
work
intelligently.
work
together.
MODx
Current
|
Dev
|
SVN Root
|
JIRA (Bugs)
|
Confluence (Revolution Wiki)
|
Fisheye SVN Browser
Pages: [
1
]
Go Up
Print
« Previous topic
Next topic »
Jump to:
Please select a destination:
-----------------------------
Announcements
-----------------------------
=> Important News
=> Security Notices
-----------------------------
Commercial Support
-----------------------------
=> [CS] About Commercial Support
-----------------------------
Development & Coding
-----------------------------
=> Commercial Inquiries & Bounties
=> Core Code
===> MODx Next
===> xPDO
=> Module, Plugin & Snippet Creation and Modification
=> In Development
=> Templates
-----------------------------
Add-ons, Extensions & Elements
-----------------------------
=> Module, Plugin & Snippet Usage
=> General Repository Items Support
=> Navigation & Tagging/Taxonomy
===> Wayfinder & DropMenu
=> Creating & Repurposing Content
===> Ditto
===> Jot
===> Front-end Document Management
=> Users, Authentication & Personalization
===> WebloginPE
===> WebLogin, WebSignup and WebChangePwd
=> Rich Text Editors & File Browser
===> TinyMCE
===> FCKeditor
===> MCPuck File Browser
=> Forms, Form Processing & Anti-Spam
===> eForm
=> Search
===> AjaxSearch
=> E-business
=> Polls, Calendars, Address Book and Community
=> Third-party integrations
=> Images, Videos & Podcasts
===> MaxiGallery
=> Manager, Parser & the Core
===> Backup & Versioning
===> Doc Finder
===> ManagerManager
===> PHx
=> Templates
-----------------------------
Support
-----------------------------
=> Release Support
===> 0.9.6.3
===> 0.9.6.2
===> 0.9.6.1
===> 0.9.6
===> 0.9.5 and earlier
=> General Support
===> MODx 101
===> E-Commerce, E-Marketing, Analytics & SEO
===> Hosting Experiences
===> IIS / Windows Hosting Issues
=> Documentation, Tips & Tricks
===> Documentation Suggestions & Corrections
-----------------------------
General Discussions
-----------------------------
=> General MODx Discussions
=> Webworker Lounge
=> Wishlist
=> You and Your Sites
=> modxcms.com Discussions and Suggestions
=> Off-topic
-----------------------------
International Support & Translations
-----------------------------
=> Internationalization
=> Bulgarian
===> Поддръжка
=====> Често задавани въпроси
=====> Инсталация
=====> Модули, Плъгини, Снипети и код
=====> Дизайн и Шаблони
===> Документация, Ръководства и Превод
=====> Документация
=====> Ръководства
=====> Превод
===> Общество
=====> Съобщения
=====> Представете се
=====> Представете сайта си
=====> Дискусии извън MODx
=> Chinese
=> Czech
===> Oznámení
=====> Důleitá oznámení/novinky
=====> Bezpečnost
===> Komunita
=====> Oznámení
=====> Představte se, prosím
=====> Ukázky práce
=====> Různé aneb cokoli co se jinam nehodí
===> Podpora
=====> FAQ (často kladené otázky)
=====> Instalace
=====> Moduly, pluginy, "snippets & code" (ablony zdrojových kódů)
=====> Design & ablony
===> Dokumentace, tutoriály (návody) a překlady
=====> Dokumentace
=====> Tutoriály (návody)
=====> Překlady (lokalizace)
=> Dutch
===> Ondersteuning
=====> Veel gestelde vragen
=====> Modules, Plugins, Snippets & Code
=====> Design & Templates
===> Documentatie, Tutorials en Vertalingen
=====> Documentatie
=====> Tutorials
=====> Vertalingen
===> Community
=====> Aankondigingen
=====> Stel jezelf voor
=====> Site Showcase
=====> De stamkroeg
=> Filipino
===> Suporta
=====> Kadalasang tanong
=====> Instalasyon
=====> Moduler, Maidadagdag, Karagdagang mga Code
=====> Desenyo at Templates
===> Dokumentasyon, Mga Turo, Mga Salin
=====> Dokumentasyon
=====> Mga Turo
=====> Mga Salin
===> Kumunidad
=====> Anunsyo
=====> Ipakilala ang sarili
=====> Ang Galing ng pinoy
=====> Tsismisan atbp
=> Finnish
===> Tuki
=====> UKK
=====> Asennus
=====> Moduulit, liitännäiset, koodinpätkät
=====> Ulkoasu/Sivustopohjat
===> Dokumentaatio, oppaat ja käännökset
=====> Dokumentaatio
=====> Käännökset
=====> Oppaat
===> Yhteisö
=====> Tiedotteet
=====> Esittele itsesi
=====> MODx sivustosi
=====> Kahvihuone
=> French
===> Support
=====> FAQ
=====> Installation
=====> Module, plugin, snippets
=====> Design/Templates
===> Documentation, Tutoriels et Traductions
=====> Documentation
=====> Traduction
=====> Tutoriels
===> Communauté
=====> Annonces
=====> Présentez vous
=====> Vos sites
=====> Le Bistrot Français
=> German
===> Support (de)
=====> FAQ (de)
=====> Installation (de)
=====> Module, Plugins, Snippets & Code (de)
=====> Design & Templates (de)
===> Dokumentation, Tutorials und Übersetzung
=====> Dokumentation
=====> Tutorials (de)
=====> Übersetzung
===> Community (de)
=====> Ankündigungen
=====> Stellt Euch vor
=====> Beispielseiten
=====> Off Topic / Verschiedenes
=> Hebrew
===> הכרזה
=====> חדשות חשובות
=====> אבטחה
===> תמיכה
=====> התקנה
=====> תיעוד, מדריכים ותרגומים
=====> עיצוב ותבניות
=====> שאלות נפוצות
===> תיעוד, מדריכים ותרגומים
=====> תיעוד
=====> מדריכים
=====> תרגומים
===> קהילה
=====> הודעות
=====> הצג את עצמך
=====> אתרים לדוגמא
=====> כללי
=> Irish
=> Italian
===> Supporto
=====> FAQ
=====> Installazione
=====> Moduli, Plugin, Snippet e altro codice
=====> Web Design e Template
===> Documentazione, Tutorial e Traduzione
=====> Documentazione
=====> Tutorial
=====> Traduzione
===> Comunitŕ
=====> Annunci
=====> Presentazioni
=====> Siti in vetrina
=====> Chiacchiere in libertŕ
=> Japanese
===> サポート
=====> 良くある質問
=====> インストール
=====> モジュール・プラグイン・スニペット・本体
=====> デザインやテンプレート
===> マニュアル・テュートリアル・翻訳
=====> マニュアル
=====> 事例集、テュートリアル
=====> 日本語化
===> コミュニティ
=====> お知らせ
=====> MODxサイト展示場
=====> 自己紹介
=====> 雑談
=====> 国産リソース
=> Persian - فارسي
===> پشتيباني
=====> راهنما
=====> نصب
=====> ماژول , پلاگین ها , کد ها و جزییات
=====> طراحی و قالب ها
===> مستند سازی , آموزش ها و ترجمه ها
=====> مستند سازی
=====> آموزش ها
=====> ترجمه ها
===> انجمن ها
=====> اخبار
=====> معرفی کردن خود
=====> نمایش دادن سایت ها
=====> بحث های عمومی و سایر موضوعات
=> Polish
===> Wsparcie
=====> FAQ
=====> Instalacja
=====> Moduły, pluginy, snipety i kod
=====> Wygląd i szablony
===> Dokumentacja, tutoriale i tłumaczenie
=====> Dokumentacja
=====> Tutoriale
=====> Tłumaczenie
===> Społeczność
=====> Ogłoszenia
=====> Przedstaw się
=====> Twój serwis WWW
=====> Hyde Park
=> Portuguese
===> Suporte
=====> FAQ - Dúvidas Frequentes
=====> Instalaçăo
=====> Módulos, Plugins, Snippets e Código
=====> Design e Templates
===> Documentaçăo, Guias e Traduçőes
=====> Documentaçăo
=====> Guias
=====> Traduçőes
===> Comunidade
=====> Anúncios
=====> Apresente-se!
=====> Bar da esquina (fora de tópico)
=====> Portfólio de Sites
=> Russian
===> Поддержка
=====> ЧАВО (FAQ)
=====> Установка
=====> Модули, плагины, сниппеты и код
=====> Дизайны и шаблоны
===> Документация, Уроки, Перевод
=====> Документация
=====> Уроки
=====> Перевод
===> Сообщество
=====> Объявления
=====> Представьтесь публике
=====> Галерея сайтов
=====> Диван
=> Scandanavian
===> Support
=====> Frĺgor och svar
=====> Installation
=====> Moduler, plugins, snippets och kod
=====> Design & sidmallar
===> Dokumentation, guider och översättningar
=====> Dokumentation
=====> Guider
=====> Översättningar
===> Webbgemenskap
=====> Meddelanden
=====> Presentera dig själv
=====> Visa upp dina webbsidor
=====> Ordet fritt
=> Slovak
=> Spanish
===> Soporte
=====> FAQ
=====> Instalación
=====> Modulos, Plugins, Snippets & Código
=====> Diseńo y plantillas
===> Documentación, Tutoriales y Traducciones
=====> Documentatción
=====> Tutoriales
=====> Traducciones
===> Comunidad
=====> Anuncios
=====> Presentaciones personales
=====> Muestra de sitios
=====> El Café
=> Swedish
=> TÜRKÇE (Turkish)
===> Destek
=====> SSS
=====> Kurulum
=====> Modüller, Pluginler, Snippetlar & Kodlar
=====> Dizayn & Temalar
===> Belgeleme, Eğitmenler ve Çeviri
=====> Belgeleme
=====> Eğitmenler
=====> Çeviri
===> Topluluk
=====> Duyurular
=====> Kendinizi Tanıtın
=====> Site Vitrini
=====> Konu Dışı