Request for Duration library localizations

M

Matthew Harris

If you speak another language and would like to contribute to the
Duration library, you can contribute largely by writing short
translation files!

You can install Duration like-so:
$ gem install -r duration (may need to be root)

The default English localization can be used as a sample reference to
building your own. Currently there are two localizations, English and
Korean.

The English localization can be found at:
http://pastie.caboo.se/131325

Thanks in advance to anyone who comes up with translations :)
Also, since I can't verify the correctness of anyone's translations, I
would also appreciate any feedback it (because I only speak two languages).
 
F

F. Senault

Le 21 décembre 2007 à 15:30, Matthew Harris a écrit :
The default English localization can be used as a sample reference to
building your own. Currently there are two localizations, English and
Korean.

French is quite straightforward :

class Duration
module Localizations
# French localization
module French
LOCALE = :french
PLURALS = %w(secondes minutes heures jours semaines)
SINGULARS = %w(seconde minute heure jour semaine )
FORMAT = proc do |duration|
str = duration.format('%w %~w, %d %~d, %h %~h, %m %~m, %s %~s')
str.sub(/^0 [a-z]+,?/i, '').gsub(/ 0 [a-z]+,?/i, '').chomp(',').sub(/, (\d+ [a-z]+)$/i, ' et \1').strip
# Produit un message du genre :
# 10 semaines, 2 jours, 3 heures, 4 minutes et 5 secondes
end
end
end
end

Fred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top