Hi guys
i need a code for change Swedish language to english
for ex:
é = e
ö = o
ø = o
help please
thank you
8 replies to this topic
#1
Posted 30 November 2011 - 12:37 AM
|
|
|
#2
Posted 30 November 2011 - 06:01 AM
You want to translate, or simply change some char to the english equivalent?
#3
Posted 30 November 2011 - 01:36 PM
yes
#4
Posted 30 November 2011 - 03:21 PM
Normally, when someone give you a choise between option A and option B you don't answer with yes
#5
Posted 30 November 2011 - 09:49 PM
If you have the iconv function, you should be able to transliterate it in to the appropriate lettering:
<?php
$utf8_sentence = "é = e
ö = o
ø = o";
//set to your locale
setlocale(LC_CTYPE, 'en_US.UTF8');
//transliteration
echo iconv('UTF-8', 'ASCII//TRANSLIT', $utf8_sentence);
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#6
Posted 07 December 2011 - 01:30 PM
Actually translating text into different languages is very hard. Your best chance is to use a API for a good translator (Google Translate).
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).
#7
Posted 07 December 2011 - 06:18 PM
bbqroast said:
Actually translating text into different languages is very hard. Your best chance is to use a API for a good translator (Google Translate).
I believe he means "transliterate" (Write or print (a letter or word) using the closest corresponding letters of a different alphabet or language.) which is a fair bit easier. This can have its use in displaying foreign names in urls (.../Métis/ -> .../Metis) or ASCII neutralization.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#8
Posted 11 December 2011 - 09:55 AM
Alexander said:
I believe he means "transliterate" (Write or print (a letter or word) using the closest corresponding letters of a different alphabet or language.) which is a fair bit easier. This can have its use in displaying foreign names in urls (.../Métis/ -> .../Metis) or ASCII neutralization.
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).
#9
Posted 11 December 2011 - 02:47 PM
bbqroast said:
Got it! There is a PHP function that takes a string and two arrays and then searches for letters (or words) in the string from the first array and replaces them with letters from the second array.
If the text is multibyte, it may see the first byte of the character as a letter and replace it or other things. PHP only sees unicode strings as separate bytes. It could be hard to do this however, so that is a valid solution although transliteration functions save almost all of the work provided you have them.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









