Greetings!
I must admit I'm a little overwhelmed with how fast this group took
off. It's very exciting to see so many of you interested in being
involved.
So let's dig in. MooTools -more (the official plugins repository) is
nearing its next release date. Currently the library contains two
items that output text for the user - FormValidator and Date. We may
be adding additional items in the future, but for now, these are the
only two.
Both of these came from my repository (
http://www.clientcide.com/js).
There the files already had the ability to be translated and I had
numerous awesome people (some already in this group) send in
translations which I published. Some of these are incomplete - we have
added new items that need translating and the content sent in months
ago doesn't include these.
You can see the translations currently available here:
http://github.com/anutron/mootools-more/tree/master/Source/Localization
You'll see we have files for numerous languages, but not all of them
are complete. The only two complete language files are
Date.English.US.js and FormValidator.English.js (because we authored
them). What we need is for you to help us translate these into
whatever languages you are fluent in.
Let's look at one of these files, Date.English.US.js:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/*
Script: Date.English.US.js
Date messages for US English.
License:
MIT-style license.
*/
MooTools.lang.set('usENG', 'Date', {
months: ['January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'],
days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
'Friday', 'Saturday'],
//culture's date order: MM/DD/YYYY
dateOrder: ['month', 'date', 'year', '/'],
AM: 'AM',
PM: 'PM',
/* Date.Extras */
getOrdinal: function(dayOfMonth){
//1st, 2nd, 3rd, etc.
return (dayOfMonth > 3 && dayOfMonth < 21) ? 'th' : ['th', 'st',
'nd', 'rd', 'th'][Math.min(dayOfMonth % 10, 4)];
},
lessThanMinuteAgo: 'less than a minute ago',
minuteAgo: 'about a minute ago',
minutesAgo: '{delta} minutes ago',
hourAgo: 'about an hour ago',
hoursAgo: 'about {delta} hours ago',
dayAgo: '1 day ago',
daysAgo: '{delta} days ago',
lessThanMinuteUntil: 'less than a minute from now',
minuteUntil: 'about a minute from now',
minutesUntil: '{delta} minutes from now',
hourUntil: 'about an hour from now',
hoursUntil: 'about {delta} hours from now',
dayUntil: '1 day from now',
daysUntil: '{delta} days from now'
});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Most of this is pretty straight forward (hopefully). There are a few
items that are a little esoteric. For instance, 'dateOrder' is used to
determine how the culture orders the date (MM/DD/YYYY in the US, DD/MM/
YYYY in most of Europe).
In some of the items there are variables that get substituted. For
instance 'daysUntil' has '{delta} days from now' and obviously {delta}
is going to be a number ('12 days from now').
There is also a concept of language cascading. Let's look at
Date.English.GB.js:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/*
Script: Date.English.GB.js
Date messages for British English.
License:
MIT-style license.
*/
MooTools.lang.set('gbENG', 'Date', {
dateOrder: ['date', 'month', 'year', '/'],
cascades: ['usENG']
});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file gives a different dateOrder (the European style) but then
sets a cascade to the US English settings. This is because Great
Britain uses a different date order, but the rest of the values are
identical to the US English ones. Cascades are an array of other
language ids so that if a language is missing a value, the first item
in the array will be checked for that value. If not found there
either, then the second one and so on. By default, all of the
languages cascade to English as these are the files we know at least
have a value. If you're working on a language that is close to another
language, you might cascade it first to that other language and then
to English. If you have two nearly identical languages with only one
or two differences, you can describe the difference in one file and
cascade it to the other.
Your job is to look and see if we already have a date file for the
language(s) you know. If we do, see if it's complete by checking it
against the English version. If not, add the missing content. If we
don't have a language file for the one you know, then create it.
To send it in you have two options. The preferred option would be for
you to fork it on github and add your new language file(s) and then
send me (anutron on github) a pull request. Alternatively, if you
aren't familiar with git, you can just paste your files into a new
thread here on these forums and we'll pick them up. If you're
concerned with encoding (if your language requires an encoding that
you think the forums might mangle) you can email it to me - (anutron
[at] g m a i l <dot> com). If you do email it, post it here anyway.
Thanks again for stepping up to help out. This is most appreciated.
Aaron & the MooTools Team