Support Forums

JS special chars (spanish)

This is a discussion on JS special chars (spanish) within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Hi everyone, My team and I are translating this website into Spanish and we have done the corresponding changes so ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 03-21-2009, 03:15 AM   #1
Junior Member
 
Join Date: Mar 2009
Posts: 5
Rep Power: 0
edittio is on a distinguished road
Default JS special chars (spanish)

Hi everyone,

My team and I are translating this website into Spanish and we have done the corresponding changes so that it can work with utf8. Everything is going well so far with the exception of the special characters in Javascript. We have declared variables in "spanish.psp" and we can't get a format legible both in html and in alerts JS. For instance:

define ("LANG_CAUTION", "Atenci�n");
can be read properly in the JS alert but not in html, and

define("LANG_CAUTION", "Atención");
the other way round (it's ok in html, but wrong in JS).

How could we make it work in both ways?

Thanks
edittio is offline   Reply With Quote
Old 03-21-2009, 09:23 AM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 135
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Hi,

You could always define a new term and then change the javascript to use it.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 03-22-2009, 05:33 AM   #3
Junior Member
 
Join Date: Mar 2009
Posts: 5
Rep Power: 0
edittio is on a distinguished road
Default

Thanks Eric. It's a good solution but when implementing it I've tryed with "categor�a categoría" to see the differences and the result shown by the alert is "categor?a categoría" ie, it doesn't show accents (?) or interpret the html. Any ideas with this regard?

I have also seen that the new version of the administration system in Spanish (4.1.1) doesn't show the special characters either. Shall I make some special modifications in order to rectify this?
__________________
5lobitos
v4.1.1 Developer- Default template
edittio is offline   Reply With Quote
Old 03-22-2009, 09:40 AM   #4
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Have you tried declaring the charset within the javascript declaration itself?

Example:
<script type="text/javascript" src="javascript/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="javascript/main.js" charset="utf-8"></script>

I haven't tried this myself, but I did a "Google" search for the subject and it seems as though javascript character sets are separate from the HTML declaration. In other words even though the HTML and the database may be UTF-8 encoded, the javascript is not, which is why you get a different behavior in the display of these types of characters from only in the javascript.

Hope that helps.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Reply

Tags
spanish , special chars

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with chars Plamen Technical Support 0 08-29-2008 06:50 AM
bug on external.php for spanish cedano Technical Support 1 06-25-2008 03:37 PM
Problem with spanish language canariasdata Technical Support 8 05-16-2008 04:49 AM


All times are GMT -4. The time now is 11:50 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0