Jump to content
TNG Community

Getting started with Spanish


Sarahlmc

Recommended Posts

I have my English site completely built.  I went and added Spanish as a language.  Now I have the index page in the Administrator ONLY version showing Spanish  text.   In the public version I do not see any way to change languates but Espanol shows up and not English in the top right corner in the Admin version - but all the text is in English.  If it was like the index page where the English shows up and an empty box below for the Spanish, I would just fill that in; however,  I am very leery of losing the English in these pages to add the Spanish.  Do I just add the Spanish and hope that everything is OK?  If I saw English in the pull down I would feel better.   

My Spanish UTF -8 language folder only shows the information that was there on the date (a month ago) that I installed TNG.  I do not see an indexS.php.   And when I look at the page in English, I do not see a place to switch languages.  In the code for the index.php I see some if statements about the  languageID and numlangs but I don't see where these variables are set.   And I don't see how to change or add a language to the Most Wanted and What's new pages.  I have a number of custom pages- but I already have those pretty well translated, so it is just a question of getting things into the right place.   

Does someone have a French or Spanish site that also uses English that I could look at and who would guide me?  I actually studied French in school, but I have lots of Argentinian family so I am doing Spanish.  My son is fluent in Spanish and helps me with it.

 

Link to comment
Share on other sites

Not all templates have the language drop box preinstalled on the index page.  I think you may have to go to a page other than the index and it will have the language drop down there.  After you change that to Spanish, then when you go home it will have the session setting the language and know to display the index in Spanish.  If this is the case with your template, you may just need to figure out how to get the language drop down added to your index file so that it will not be confusing and non-intuitive of how to change the language on the index page for your Argentinian family.

Brent

Link to comment
Share on other sites

Yes.  Every language you want to use must be added to the TNG Language tables.  The English defined in the Admin > Setup > General Settings is your default language.  If you only use one language, you don't need to Add the languages to Admin > Languages but if you want to allow users to switch languages, you need to add all the languages you want to support.

Link to comment
Share on other sites

I did add English and I was able to work on the Spanish version of Most Wanted and What's new.  However the tree names are still in English.  Is there a place in the configuration files to put the Spanish version of the tree names - without displacing the English versions?  

 

Link to comment
Share on other sites

Switching languages does not translate the data extracted from the database to the new language.  Only the text that comes from the text.php, alltext.php, or admintext.php file variables get displayed in the new language.

There are currently no separate translation fields in the database records. 

Link to comment
Share on other sites

Ken, you misunderstood my question.  I realize that I do the translation, my question is, where do I input the translation for the names of the trees.  In several of these pages it is just a pull down field, with the English names.

Link to comment
Share on other sites

You misunderstand my reply.  There is no place where you can translate the tree name.  If you have only one other language besides English you could change your tree name to show both an English (Spanish) tree name.

The tree name is a field in the database.

Link to comment
Share on other sites

As I said if you only have English and Spanish on your site, you could change the tree names to use both languages in Admin > Trees.   If you have multiple languages it may not make sense to translate the tree names there.

Link to comment
Share on other sites

Question 2.  I have a batch of pages that I developed from the historytemplate.php.  I noticed when I went to them, that there is a language dropdown box.  However I do not see anyplace in the coding that I can put the Spanish versions from yourtitle to the HTML.  I have all of that ready to insert, I just need to know where to put in it in the coding.  I do remember something about the Spanish folder.  Do I just code the entire page as a new page in Spanish and stick it in the Spanish folder?

 

Link to comment
Share on other sites

I went to the wiki and also to the forum with the Acadian family example in French.  The thing that bothered me is the comment about having no HTML in the pages.  One of the pages that I want to translate is a page of links!  Several are pages of photos including a dedication page.  Is the answer to use text variables and use an echo text statement?  Some of my pages would work fairly well with a shell page- but many have either photo links or absolute links.    Do I need to create a text variable for each of the various link labels?  I suppose another alternative would be to have a Spanish site that was separate from the English one - but that seems to be to be very redundant.  What I was hoping that I could do was to have a Spanish pages called genlinkssp.php, dedicationsp.php etc and just have the system go to the page that ended in sp.  That is how I did my original site!   My original site is at http://genealogy.smcactuary.com and my test (TNG site) is at http://test.smcactuary.com.   My original site was strictly simple HTML and was nowhere near as complex as this is.

Sarah

 

Link to comment
Share on other sites

I don't know what you mean by having no HTML in the pages.  Specific URLs would be more helpful than a link to your site.

You can use the historytemplate.php to create the shell page and your HTML page could be the include script from the language folder.  The .htm or .html extension could be simply changed to .php when saved to the language folder.  This is how I created my English and French pages on my  site.   See My Roy Family for example and switch between English and French.  The file that is in the folder is essentially an .html page but without any of the <head></head><body> information which is generated by the file created from the historytemplate.php.

Link to comment
Share on other sites

I created all my pages using the history template.  Here is an example of what I did.  Can you elaborate further on the include?  Since the place for the HTML was after the php was closed out.  The philosophysp.html page is my old page and the navigation information would be removed for TNG.  When I put the information in the English Folder and the Spanish folder how is it identified?  I have 12 user pages - and I see that you have quite a few as well.  

 

BTW, I went to your site - which is quite impressive.  Later I would like to add a guest book.  I had one in the past but it was on a separate site that closed.

Sarah

philosophy.php

philosophysp.html

Link to comment
Share on other sites

Sarah,

Attached are revised pages.  The philosophy_updated.php file should be renamed to simply philosophy and put where you originally planned to put your page.

The philosophy_English file should be renamed to simply philosophy.php and placed in your English or English-UTF8 folder depending on whether your site is ISO-8859-1 or UTF-8.

The philosophy_Spanish file should be renamed to simply philosophy.php and placed in your Spanish or Spanish-UTF8 folder depending on whether your site is ISO-8859-1 or UTF-8.

I changed  $yourtitle to use $title with a $text variable that you would define in your language/cust_text.php file. I copied and pasted from my file and forgot to change the $title to $yourtitle.  You will also need to make some adjustments to the Spanish file, but this should give you a head start.

Please update the wiki as you see fit to make it easier for other new users to understand how to create the multi-language pages.

 

philosophy_English.php

philosophy_spanish.php

philosophy_updated.php

Link to comment
Share on other sites

Thank you.  I am studying and working on these.  The English page works perfectly,  The Spanish page has a problem with the i with an accent (acute), it shows up as a diamond with a question mark every place it occurs.  It is in the UTF8 character set, Do I have to replace the letter letter with &#237 every time it occurs in a word?  Or should I change character sets? 

Other than this it is working beautifully and I thank you.  I now understand how to do this and will get several more pages done.  Then yes, I would be happy to update the WIKI.

Sarah

 

Link to comment
Share on other sites

Sarah,

How is your site setup?  What is the TNG charset in Admin > Setup > General Settings > Language?  What is your database collation sequence?  Hopefully since it is a new site it was defined as UTF-8.

If it is UTF-8, then you need to create a new version of the Spanish file.  or change the encoding of the one I sent to Encode in UTF-8 in Notepad++  Copy the content of your original html file and paste it over the existing content.  You should be able to enter the accented characters using the US-International keyboard.

Attached is a revised where I did exactly what I indicated above.

philosophy_spanish_utf8.php

Link to comment
Share on other sites

Why is this better and necessary?  Wouldn't be easier to just go back to the original Spanish character set?  I have twelve pages all of which were copied and pasted from my old site and even the data that I copied and pasted yesterday from Google translate does not work with this character set.   I do use Notepad++ , and I saw it encode in UTF 8 and it is not readable - it may be easy to encode but hard to evaluate.  I can certainly move my pages to the Spanish folder from the Spanish UTF -8 folder.  But then can I delete Spanish UTF 8 and add Spanish as Languages?  Or am I trapped because the UTF 8 was "better"?  My son did the Spanish typing - I haven't done it and I would rather not type everything again.  I suppose that I could do a find and replace on the characters that don't work.  That might be the best solution.  Thanks for your help.

Sarah

Link to comment
Share on other sites

OK I tried two approaches neither of which worked.  First I left everything in Spanish UTF-8 and tried to find the accented characters in Notepad++  in from the original philosophy page and replaced them with the accented characters from your page - and reuploaded. Of course I could not see any difference!  When I reloaded the page on my side - the question marks were still there (and the file size was smaller than yours).  So I don't think that I accomplished anything.

Secondly I tried deleteing Spanish UTF 8 and adding Spanish (But did not define a character set - what should I have selected) and the problem still persisted.  I then went to my original site where everything looks fine!  I went back and redefined my character set as ANSI and it works!!  So I guess that the answer is to use ANSI.  It may be older but I don't have to encode or jump through hoops.  I can use my old pages.  Now on to figuring out how to change my coding to come up with the Spanish names on the welcome/index page.  I think that i saw something in the WIKI...

 

Sarah

Link to comment
Share on other sites

Sarah,

How is your site setup?  Please answer the following questions:

What is the TNG charset defined in Admin > Setup > General Settings > Language?

What is the collation sequence of your database?

What is the encoding on the file that you saved in your Spanish folder?

ANSI is not necessarily the way to go.  4 things need to be in synch for accented characters to display correctly.  The TNG charset, the database collation sequence, the GEDCOM used if you import data, and the charset encoding if you create custom pages.  They all need to be either UTF-8 or ISO-8859-1 (ANSI).  You cannot have a mixture of both. 

If your welcome page is generated by the TNG Template Settings, then you should be able to enter the data in Spanish and English.

Without a URL to your site that points to the page having a problem, all one can do is offer generic type of suggestions.

Link to comment
Share on other sites

Ken,

  The original character set is UTF -8,

One of my genealogy programs (an old one just gives me a choice of English or English and Hebrew) for the GEDCOM - I selected English (only).  But there are no special characters there (other than one that is not in either character set - that is used for Holocaust victims).  So ignoring that one, I think we are ok.

Now the Philosophy page looks ok in Spanish but the Dedication page doesn't.  I can see why we need consistency. 

If I go back and re define the character set as ANSI, I can re-do the Gedcom from Jim's family (which has Danish letters especially an o with a slash through it).  I had redone it to be in UTF -8 but it does work in ANSI.  But you mentioned something about the table collation sequence.  I gather that changing from UTF 8 back to ANSI would create problems there.  I suppose that the easiest solution would be to use notepad++ and encode for UTF -8 and keep two versions of  the Spanish (one human readable and the other encoded).  Or does the fact that the Philosophy page now works means that my search and replace did work?

Sarah

 

 

Link to comment
Share on other sites

Ken 

 The way that the Spanish looked good was I had selected ASCII but it only worked on the Philosophy page and as soon as I set the character set to UTF 8, I was back to all accented characters looking bad.

I am going to try the encoding, much as I dislike it.

Sarah

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...