I have a list of Czech names associated with days of the year - all Czech people have their birthday as well as a "name day". I'd like to display the appropriate name(s) associated with each day (there is a long list) according to the user's computer date. Before investigating coding this myself I wanted to ask if you may know a Javascript script for this type of application already, or know how I should go about it. This site is PHP.
You can see the list of Czech name days here: http://en.wikipedia.org/wiki/Name_days_in_the_Czech_Republic
Yes, there is one. The page is in german unfortunatly: http://www.web-toolbox.net/webtoolbox/datum/datum-tagestipp365.htm
You may use google translate to translate the description.
Related
I'm working on a bilingual WordPress project which is translated with TranslatePress plugin. Sadly TranslatePress ignores all number fields and won't let me change their values depending on the countries number format. The offiical support team told me, it's not possible at this moment.
The original language of the page is German and the second language is English. The page contains a lot of number information for cities etc. which are put in like this 13.502.552 Since TranslatePress won't let me convert these numbers by hand I'm looking for a way to convert them for the entire site maybe through functions.php, is this possible? Is there a way to check if locale is set to en_GB and to convert all the numbers to 13,502,552 on the fly?
I already came across number_format_i18n, but could not find a way to use it properly for my purpose.
Any ideas?
In a project of my company there is a website available in 6 languages. The site sends some emails to customers/members. Every phrase/word is stored in database and all work well in the website. Our main problem appears in emails.
In each email there are daily reports. We use set_locale() to define each language and "show" the day names (months also) to the proper selected language. This works ok.
In some cases there are more than one emails to be send (in 2 different languages) - here we have problem.
Every info in email appears correct - texts/translations from database.
Day names (and month also) appear only in the first language in both emails.
So, if the first email was in german and the second in french, the french email will have everything in french excpet the day names that will be in german (even though that we execute set_locale again before sending the second email)
Why is that? Is this some set_locale bad behavior? How can we prevent/fix this? Thank you for any insight/tips
EDIT:
the code we use is: setlocale(LC_ALL, $setLocale);
where setLocale would look like "fr_FR.UTF8"
you should use this module (from Zend Framework): http://framework.zend.com/manual/en/zend.locale.html
it is really useful to identify the browser context language.
For translations you can use Zend Translate:
http://framework.zend.com/manual/en/zend.translate.html
It is really useful!
Not sure if stackoverflow is the most appropriate place for this question.
I am currently building a web application that will manage content, ecommerce and allow users to participate.
I am using php's intl extension to deal with different number formats and so on. gettext will be used to provide translations of the actual text in the application.
This question isn't really a technical one, but more as to how the user sets the language/version of the web app.
I have came up with a possible scenarios:
(Country regions) User selects his country and this determines his language. If the language for his country is not avaliable, default to default language.
(Language) User selects his own language, and he selects his own country/time zone settings. That means we can have users in say the United states reading content in Japanese.
With the first option, obviously it is quite fool-proof. The user claims he is from canada, so we display the content in english (en_ca) or french (fr_ca if avaliable).
However, not every web site built on top of the application will be big enough to warrant translations based on locale (i.e. canadian french (fr_ca) vs french french (fr_fr).
Some site would be quite small, so it doesn't matter where the user comes from, he should be able to select either French or English when browsing the site. However, this leads to another issue. If the user selects the content to be shown in french, how do we format things like numbers and currencies? We cannot directly infer his locale from the language he has chosen.
I have looked around the web at some "big" websites to look at how they do things.
Amazon - (Country Regions) Different sites for different countries, i.e. Amazon japan is only avaliable in japanese.
Microsoft - (Country Regions) Some countries have multiple languages. (fr_ca) vs (en_ca).
Engadget.com - (Language) English, Japanese, Chinese (both simplified and traditional).
FaceBook - (Language), but offers different versions of languages (fr_ca and fr_fr)
So I guess the question is, should I force all users of the web application to build their content around the countries/regions or languages? Or should I allow both scenarios?
Cheers :)
As a professional localizer, I reccomend "language" if there is no difference in content.
The reason why Amazon or MS ask for country is that the content is different for each territory. For stuff that is not available, say in Japan, why would they want to translate it to Japanese? Plus it's misleading to the Japanese reader, even if they are on the US site.
On the flip-side, if you offer Country as the selection, then users may expect to see different content based on the coutry they choose, and that might be misleading.
These days a lot of people are mutli-lingual so if the content is the same, defaulting by location then offering the language selection on top is more user-friendly.
I hope my thoughts might help. This is a tough question and depends on many factors - there is no 'right' answer. :)
We did something similar to this in our web app. We essentially just used the currency format of the "home" country for the language. So, if they choose French, they get France's formatting. German, Germany's formatting, etc. It won't always be the correct one but for our app we haven't had any complaints yet, so I assume that works the best if your users aren't too picky. We have a decently small userbase, however (<= 1000 visitors per instance of our app), so you may want to take this advice with a grain of salt ;)
So I need to make a site available in different languages. Using PHP 5.x and MySQL 5.x. I believe I will be using gettext which seems fine for static text throughout the site but what about dynamic data that is stored in the db? Im referring to things like stories, events business listings etc. How do I get those to display in a different language? My initial thought was in the backend have them be able to enter multiple versions of a story, event or listing, one for each language they want to use on the site. But there could be thousands of entries times how many languages they want to show. Is there a better solution/idea that someone can point me to?
Also another issue I was thinking is currently the site allows you to search events/stories/listings, how would that work in different languages? Im assuming if someone selected the site to show in spanish they are going to use spanish words to search the site, but if the information in the db is in english I dont know that would work. Any suggestions on that?
If you want the stories to be correct in all languages, then you need them stored in all languages and provide the backend to do the translations or enter the stories on different languages as you initially thought.
If you don't like that, you might add the google translate element in your pages, to provide automatic (not correct) translation.
For the search question, I would only search for the keywords in the fields of the database in the same language as the user. If Joe is visiting your page in English, only look for the search terms in title_en, content_en, description_en fields of your database (or the ones with language='en' if you have one row per article and translation in the database, instead of one row per article (with all translations inside)). Obviously, this does only work if you put all the translations on the database.
The best solution I have seen described is this.
As i18n CMS sites as you describe are in a constant state of flux, with new articles being added, some of which have had translations, in some languages.
If an article in a chosen language has not yet been translated then show a default language (English?).
Then pick any ideas which appeal to your case:
a) If showing a default article in English also throw onto the page an input box and invite your audience to translate it for you.
b) If showing a default article in English also put on the page an offer to send the content to google translate as well as doing a) above
c) put a bounty on the translation and optionaly do a) and/or b) above.
My application has a 2.7 million records table with the list of all cities and villages in the world (provided by GeoNames.org). Each city has it's name in the native language. This database will be searched in an auto-complete form, but users should be able to type the city name in their own language (primarily Portuguese, since this will be a Brazilian website) and be able to locate the city (at least the most important ones).
For instance: Munich is a well-known German city. However, in the GeoNames database, it is registered as "München", the native German name. GeoNames provides an english representation of the name, but that basically strips the special characters of the city name (in this case, München becomes Munchen, not Munich).
Is there a way or service I can use to translate each of these cities names into Portuguese (or at the very least, English) and cache them in my database? I've looked into the Google Translation API, but in their TOS, automated processes are forbidden.
Thanks in advance.
A solution I found was parsing the WordPress translation files, it includes continents & cities in one of the language files.
Find the language you want here:
http://codex.wordpress.org/WordPress_in_Your_Language
Go to the language you want and download WordPress
Inside the zip goto: /wp-content/languages/
and open continents & cities file eg. "continents-cities-nl_NL.po"
In that file you'll have all the translated city names you can easily parse into your DB
I'm currently parsing the cities in PHP when I'm finished I can post the translated files here if you want.
How about parsing Wikipedia? I often use the "Languages" menu as a dictionary. It would take some time but since this is a one-time operation it doesn't matter that much.