Jump to content

[SOLVED] Spanish Accent Coding in "Contact Us" .tpl file


Recommended Posts

Hey everyone, I am having a bit of an issue that I am trying to sort out. On our "Contact Us" section of the website we wanted to input a small bit in Spanish for our Spanish speaking customers. I have hard coded the Spanish accent codes in the past using the entity codes for the characters (ie: &oacute and &ntilde). For some reason when I am trying to code it in the "contact-form.tpl" it is either showing up wrong or not at all. I have made sure that the file itself states Unicode UTF-8. Here is the code I am working with:

 

Original attempt:

 

<p class="bold">Para español, marque la extensión # 233</p>

 

Adjusting the code:

 

<p lang="es" xml:lang="es">Para español, marque la extensión # 233</p>

 

I have imported the Spanish localization pack in the back office, as well as enabled Spanish under the Languages tab with success. I am just having a difficult time getting the code to show and display properly. It has been a good long while since I have done any language switching code so I am very rusty (probably missed something super simple). I should also point out that when I test the code it seems to be working, just is not displaying properly. Thanks in advance,

 

J Dub

Edited by JDub1337 (see edit history)
Link to comment
Share on other sites

Hey everyone, turns out I figured it out after all. I needed to adjust the code a bit more and got it to work and show up properly. Hope this helps anyone in the future looking to solve the same thing. Thanks again for such an excellent forum!

 

J Dub

Link to comment
Share on other sites

I would have thought this much easier to do and best practice by adding text in .tpl files:

 

{l s='your text field'}

 

the way you are doing it will not work for mufti-lingual shop, well it will just in the wrong language. :)

 

Hey El Patron, when I was using the ls command script I kept getting syntax errors kicked back. Only way I could get it to work was without it. Not sure how else to fix it to be honest. This is what would kick back after doing what you had suggested:

 

'Para espa�ol, marque la extensi�n # 233'

 

Or it would just be blank, with nothing there at all

 

Our shop is only in one language with two bits of Spanish in separate places on the site. Any suggestions would be a great help! Thanks,

 

J Dub

Edited by JDub1337 (see edit history)
Link to comment
Share on other sites

I would replace hard coded spanish text with {l s='some text in english'}

 

then from the back office translations modify this english text with spanish.

 

This also allows you to modify the text as you please later and  may circumvent the issue you are having now.

Link to comment
Share on other sites

I would replace hard coded spanish text with {l s='some text in english'}

 

then from the back office translations modify this english text with spanish.

 

This also allows you to modify the text as you please later and  may circumvent the issue you are having now.

 

Wow! I had absolutely NO idea that was possible. I am pretty sure you just saved me a ton of time! Thanks a million times over El Patron!

 

J Dub

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...