persian language #316

Closed
KiarashS opened this Issue May 24, 2012 · 5 comments

Projects

None yet

3 participants

hi,
please add persian language to moment.
very thanx.

Owner

I don't know Persian, but would be glad to add it if you provide the translation! Just make a pull request to the develop branch like #305.

(function () {
var lang = {
months : "اسفند_بهمن_دی_آذر_آبان_مهر_شهریور_مرداد_تیر_خرداد_اردیبهشت_فروردین".split(""),
monthsShort : "اس_ب_د_آذ_آب_مه_ش_مر_ت_خ_ار_ف".split("
"),
weekdays : "جمعه_پنجشنبه_چهارشنبه_سه شنبه_دوشنبه_یکشنبه_شنبه".split(""),
weekdaysShort : "ج_پ_چ_س_د_ی_ش".split("
"),
longDateFormat : {
LT : "h:mm A",
L : "YYYY/MM/DD",
LL : "YYYY MMMM D",
LLL : "YYYY MMMM D LT",
LLLL : "dddd, YYYY MMMM D LT"
},
calendar : {
sameDay : '[امروز در] LT',
nextDay : '[فردا در] LT',
nextWeek : 'dddd [در] LT',
lastDay : '[دیروز در] LT',
lastWeek : '[آخرین] dddd [در] LT',
sameElse : 'L'
},
relativeTime : {
future : "در %s",
past : "%s پیش",
s : "چند ثانیه",
m : "یک دقیقه",
mm : "%d دقیقه",
h : "یک ساعت",
hh : "%d ساعت",
d : "یک روز",
dd : "%d روز",
M : "یک ماه",
MM : "%d ماه",
y : "یک سال",
yy : "%d سال"
},
ordinal : function (number) {
return 'º';
}
};

// Node
if (typeof module !== 'undefined') {
    module.exports = lang;
}

 // Browser
if (typeof window !== 'undefined' && this.moment && this.moment.lang) {
    this.moment.lang('fa', lang);
}

}());

but when i use
moment().month();
then return 4
while must return 2

Contributor

@kiyarash, in order for us to accept this language definition, we need you to create a pull request that has both tests and the language definition for Persian. #305 is an excellent example of a good pull request.

Owner

Closing this out, please submit a pull request with tests and we will gladly merge it in.

@timrwood timrwood closed this Jul 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment