boonie67 Posted April 18, 2010 Report Share Posted April 18, 2010 Switching languages: In an earlier post KRoy writes Tng does not provide a way to tranlate the data entered, however I see KRoy has the switch working on his site. How would one go about this? English To switch to french with data translated to french, please explain how would this would be done? Example of new language switch French As you can see here the language on the page is still in English, if you change language would it change all language on page as KRoy? Thanks for any help, Randal, Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted April 19, 2010 Report Share Posted April 19, 2010 Switching languages: In an earlier post KRoy writes Tng does not provide a way to tranlate the data entered, however I see KRoy has the switch working on his site. How would one go about this?EnglishTo switch to french with data translated to french, please explain how would this would be done?Example of new language switchFrenchAs you can see here the language on the page is still in English, if you change language would it change all language on page as KRoy?Thanks for any help,Randal,OurAcadianFamilyHi Randal,One approach that you can take is to create the shell page for your intro.php file using the historytemplate.php and then within the intro.php file created from the historytemplate.php where it says to replace the text, use a line like the following<?phpinclude($cms['tngpath'] . "$mylanguage/intro.php");?>In your English language folder you would have the text that you currently have in your intro.php and in your French language folder you would have the text that you currently have in your introfrancais.php. Both files need to be named intro.php. The content of the file in the language folder should start with the horizontal rule tag and not include the header or left nav portions of the page, nor the footer.Ken Quote Link to comment Share on other sites More sharing options...
boonie67 Posted May 8, 2010 Author Report Share Posted May 8, 2010 Thanks for the reply KRoy,However if I am able to follow your instructions both the English and French have function errors at the top of webpages with two text entries following it. What if any advice can you give, I must be doing something wrong.Thanks again,Randal Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted May 9, 2010 Report Share Posted May 9, 2010 Thanks for the reply KRoy,However if I am able to follow your instructions both the English and French have function errors at the top of webpages with two text entries following it. What if any advice can you give, I must be doing something wrong.Thanks again,RandalRandal,A URL to the page where the problem is occurring would be most helpful. At a minimum the complete text of the error messages being displayed might help diagnose the problem.Ken Quote Link to comment Share on other sites More sharing options...
boonie67 Posted May 10, 2010 Author Report Share Posted May 10, 2010 Ken Roy said: Randal, A URL to the page where the problem is occurring would be most helpful. At a minimum the complete text of the error messages being displayed might help diagnose the problem. Ken KRoy, I am sending as attachments the two intro files English and French then you could see the problem first hand. Maybe you could help me with this problem, I would be grateful. However if this is too much work could you recommend someone to me for hire to resolve this issue? Randal Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted May 10, 2010 Report Share Posted May 10, 2010 KRoy,I am sending as attachments the two intro files English and French then you could see the problem first hand. Maybe you could help me with this problem, I would be grateful.However if this is too much work could you recommend someone to me for hire to resolve this issue?RandalOur Acadian FamilyRandal,Attached are the files I created from your provided files. The intro.php file is currently setup to be placed in your TNG installation (or root path) directory. The French_updated_intro.php file is intended to be placed in your French folder and renamed intro.php. The English_updated_intro.php file is inteded to be placed in your English folder and renamed intro.php. Notice that the French and English files only contain the content of your page. The intro.php file contains all the TNG page protocol and formatting, header and footer.You will also need to add the following $text variables to your appropriate cust_text.php file// add to French cust_text.php$text['myintropage'] = "Page d'Introduction";$text['oursiteintro'] = "Introduction";// add to English cust_text.php$text['myintropage'] = "Introduction Page";$text['oursiteintro'] = "Intro";You can of course change it anyway you wish. Kenintro.phpEnglish_updated_intro.phpFrench_updated_intro.php Quote Link to comment Share on other sites More sharing options...
boonie67 Posted May 10, 2010 Author Report Share Posted May 10, 2010 Randal,Attached are the files I created from your provided files. The intro.php file is currently setup to be placed in your TNG installation (or root path) directory. The French_updated_intro.php file is intended to be placed in your French folder and renamed intro.php. The English_updated_intro.php file is inteded to be placed in your English folder and renamed intro.php. Notice that the French and English files only contain the content of your page. The intro.php file contains all the TNG page protocol and formatting, header and footer.You will also need to add the following $text variables to your appropriate cust_text.php file// add to French cust_text.php$text['myintropage'] = "Page d'Introduction";$text['oursiteintro'] = "Introduction";// add to English cust_text.php$text['myintropage'] = "Introduction Page";$text['oursiteintro'] = "Intro";You can of course change it anyway you wish. KenThank you so much Ken, really works great. Would this code work in the histories?Randal Quote Link to comment Share on other sites More sharing options...
boonie67 Posted May 21, 2010 Author Report Share Posted May 21, 2010 boonie67 said: Thank you so much Ken, really works great. Would this code work in the histories? Randal Ken thank you for the code and I finally figured out the histories. History of Acadian Families Switch the language and the whole page switches, it works great, just had to figure out the correct path. Randal Our Acadian Family Quote Link to comment Share on other sites More sharing options...
NLapierre Posted May 20, 2018 Report Share Posted May 20, 2018 Hi Ken I want to know if you can help me to setup my switching languages with my files? If you want, here's my files Thank you in advance Normand custom_page1_En.php custom_page1_Fr.php Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted May 20, 2018 Report Share Posted May 20, 2018 Normand, You need to cut lines 1-19 from both language specific files. Save the lines from one of the files in a separate file that you will call custom_page1.php Save the new file ( as coded it expects to be in a subfolder to your TNG folder. If you save in your TNG root folder, you need to remove the ../ before the begin.php in line 2) Add <?php to the top of each language specific page and save the files in the respective languages folder without the language name (file name should be cust_page1.php only) Add include ($cms['tngpath'] . "$mylanguage/custom_page1.php") ; to the bottom of the file created in step 2 above Add a ?> at the bottom of the file created in step 2 Above procedure is documented on the TNG Wiki as User Pages - Multi-language Quote Link to comment Share on other sites More sharing options...
NLapierre Posted July 8, 2018 Report Share Posted July 8, 2018 Sur 20/05/2018 at 07:46 , Ken Roy said: Normand, You need to cut lines 1-19 from both language specific files. Save the lines from one of the files in a separate file that you will call custom_page1.php Save the new file ( as coded it expects to be in a subfolder to your TNG folder. If you save in your TNG root folder, you need to remove the ../ before the begin.php in line 2) Add <?php to the top of each language specific page and save the files in the respective languages folder without the language name (file name should be cust_page1.php only) Add include ($cms['tngpath'] . "$mylanguage/custom_page1.php") ; to the bottom of the file created in step 2 above Add a ?> at the bottom of the file created in step 2 Above procedure is documented on the TNG Wiki as User Pages - Multi-language Hello Ken, With your latest explanations you gave me, I did not manage to make the languages work. I'm using TNG 12.0.1 with template 15 and I'm having trouble configuring the English and French languages. I can not configure the feature1.php files to feature8.php and custom_page1.php to custom_page2.php. These configurations must be the easiest because I am not a professional coding php. Please, can you help me to get there? Do you need the files? After all these configurations, where should I place all these files and which text links of the template 15 should I register for each file feature.php and custom_page.php? Thanks again and have a nice day! custom_page1_En.php custom_page1.php feature1.php feature2.php feature3.php feature4.php feature5.php feature6.php feature7.php feature8.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.