I find it a problem to copy the whole site before you start translating. If you have a one man operated fairly static site that’s ok perhaps but with a frequently changing site with multiple contributors, who are not necessarily the translators things can become quite messy pretty quickly. By the time a whole section is translated a significant amount of the original has already changed.
Instead I’ve implemented a very similar system with a folder per language and a cross-reference table, except that only the page (or a small group of pages) currently being translated is copied over. A simple plugin checks and serves a translated page if it is available. I use a customised menu script that makes the same checks. If a visitor has chosen a particular language the menu-items with a translated page will be translated and the rest will be shown in the default language.
It’s true this can be produce a bit of a miss-match site for a while but in practice my experience is that nobody is too bothered by that and the site in all languages stays much more up to date.
good day,
(using latest versions of php, apache... wayfinder 2.0, modx-0.9.5)
*Problem getting Chinese and English languages to work. All I want is the home page in English and when someone clicks on the Chinese flag, goes directly to the Chinese home page(the Chinese/English flags would always take user to home page of that language, don’t care about going to specific pages)
This is what I have so far:
1) Downloaded icons and uploaded to assets/images. Both are 16x11px in size
2) Created snippet "Redirect"
3) Created snippet "Languages" and changed:
$langnames = array(
"en" => "English",
"zh" => "Chinese"
);
4) Create TV called "Languages" with type "text", and associated with all templates
5) Edited templates to call Languages snippet. I have 6 templates which all use the same chunk{{header}}:
<div id="languages"> [[Languages]] </div>
<div id="ajaxmenu"> [[Wayfinder?startId=`1` &fullLink=`1` &outerTpl=`mh.OuterTpl` &innerTpl=`mh.InnerTpl` &rowTpl=`mh.RowTpl` &innerRowTpl=`mh.InnerRowTpl` &firstClass=`first` &hereClass=``]] </div>
<div id="banner"></div>
</div>
my css looks like:
#languages {
margin-top: 5px;
position: relative;
float: right;
width:50px;
z-index:999;
padding-right: 35px;
_margin-top: 66px;
}
Do I have the correct call in the template chunk, and is there anything wrong with the css in terms of size?
What is the problem you are seeing?
Andy
problem= I don’t know what i’ve done wrong but I can not even see the language flags and can not link to the other language page
6) My menu in manager looks like this, and all are published with page settings checked for everything(Capital and chinese letters =show in menu)They are all assigned to one of 6 templates, menu looks like this:
en (108)___________________0 menu index, with blank template and no content. Is
this what is meant by creating an empty document?
Home Page(1)_______________2 menu index , main home page for English site
Currently have [[Wayfinder?startId=`1`….] and works good
+ABOUT US (33)_____________1 menu index
+SERVICES (39)______________2
+NEWS & REPORTS (52)_______6
+SUCCESS STORIES (15)________7
+CONTACT US (6)_____________9
404 - Document Not Found (7)_ 11
RSS Feed (11)_______________12
Request an Account (5)_______13
[*loginName*] (4)____________14
Search Results (8)____________15
[*loginName*] (37)___________16
Email Newsletter (69)_________17
Thank You (46)______________18
zh (109)____________________0 menu index , with blank template and no content
Chinese Home Page(78)_______3 menu index , main home page for English site
+税法草案 (87)_______________1 menu index
+1000万借出家 (96)__________2
+2006年美国人 (100)_________6
+人类“性香 (85)______________7
+美国 (79)___________________9
404 - Document Not Found (7)_ 11
RSS Feed (11)_______________12
Request an Account (5)_______13
[*loginName*] (4)____________14
Search Results (8)____________15
[*loginName*] (37)___________16
Email Newsletter (69)_________17
Thank You (46)______________18
Start (70)___________________1 menu index. Currently have no template assigned.
Do I need to assign one? The only thing I have in here is document content: [[Redirect?id=`2`]]
…So right now my homepage comes up as English and the Wayfinder menu works great when calling as [[Wayfinder?startId=`1`….] for every template section. If I turn it to [[Wayfinder?startId=`UltimateParent`….] I get an error. I also have a separate Wayfinder call on secondary pages that lists the submenus for about us, services, etc..This also works good using [[Wayfinder?startId=`33` or ‘39’ or whatever sub menu is desired for a section.
How can I use ultimate parent for such a Wayfinder menu structure?
Also on my home page I can not see any flag image or words with the way I’m calling the snippet at the moment. I tried linking in template href…but that didn’t work.
Can someone point me in the proper direction?
So you have the images "assets/images/en.gif" and "assets/images/zh.gif"? They must be in those locations.
If you view your page source in your browser, does anything appear where you placed the Languages snippet?
At a minimum you should see a <a href=...</a>. If not then the Languages snippet is either incorrect or not being called or the languages template variable uses an incorrect format. It should be something like "zh=5" for an english page.
Andy
at the moment I do not see anything in the top right corner where I want the language to be
Are you looking at the page source, like I suggested?
Did you check the gif locations and names?
Andy