mirror of https://github.com/mue/mue.git
Added russian and arabic (thanks dondish and sheldon)
This commit is contained in:
parent
c7e93afd24
commit
8f44c2d139
|
@ -101,6 +101,10 @@ German - Messages (by [untocodes](https://github.com/untocodes))
|
|||
|
||||
Hebrew - Messages (by [dondish](https://github.com/dondish))
|
||||
|
||||
Russian - Messages (by [dondish](https://github.com/dondish))
|
||||
|
||||
Arabic - Messages (by [MrSheldon](https://github.com/MrSheldon))
|
||||
|
||||
*Feel free to pull request with other translations!*
|
||||
|
||||
## Credits
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -27,5 +27,10 @@ module.exports = {
|
|||
],
|
||||
ficodes: ['fi'],
|
||||
decodes: ['de', 'de-AT', 'de-DE', 'de-LI', 'de-LU', 'de-CH'],
|
||||
hecodes: ['he']
|
||||
hecodes: ['he'],
|
||||
rucodes: ['ru', 'ru-MO'],
|
||||
arcodes: ['ar', 'ar-DZ', 'ar-BH', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW',
|
||||
'ar-LB', 'ar-LY', 'ar-QA', 'ar-SA', 'ar-SY', 'ar-TN', 'ar-AE',
|
||||
'ar-YE'
|
||||
]
|
||||
}
|
|
@ -34,6 +34,8 @@ module.exports = class Functions {
|
|||
else if (util.contains.call(codes.ficodes, nal)) message.spMessageSet(); //Finnish
|
||||
else if (util.contains.call(codes.decodes, nal)) message.spMessageSet(); //German
|
||||
else if (util.contains.call(codes.hecodes, nal)) message.heMessageSet(); //Hebrew
|
||||
else if (util.contains.call(codes.rucodes, nal)) message.ruMessageSet(); //Russian
|
||||
else if (util.contains.call(codes.arcodes, nal)) message.arMessageSet(); //Arabic
|
||||
else message.engMessageSet(); //English
|
||||
};
|
||||
|
||||
|
|
|
@ -16,7 +16,9 @@
|
|||
█████████████████████████████████████████████████████████████
|
||||
*/
|
||||
|
||||
const { setHTMLContent } = require('./utility.js');
|
||||
const {
|
||||
setHTMLContent
|
||||
} = require('./utility.js');
|
||||
|
||||
module.exports = class Message {
|
||||
// English
|
||||
|
@ -89,4 +91,22 @@ module.exports = class Message {
|
|||
else if (hour > 20) time = 'אחר הצהריים טובים'; // If it's after 6pm, set the time string to "Good afternoon"
|
||||
setHTMLContent('.greeting', time); // Write the string contents to the HTML
|
||||
}
|
||||
|
||||
// Russian
|
||||
static ruMessageSet() {
|
||||
let hour = new Date().getHours(); // Get the current hour
|
||||
let time = 'Добрый Вечер'; // Set the default time string to "Good evening"
|
||||
if (hour < 12) time = 'добрый утро'; // If it's before 12am, set the time string to "Good morning"
|
||||
else if (hour > 20) time = 'добрый день'; // If it's after 6pm, set the time string to "Good afternoon"
|
||||
setHTMLContent('.greeting', time); // Write the string contents to the HTML
|
||||
}
|
||||
|
||||
// Arabic
|
||||
static arMessageSet() {
|
||||
let hour = new Date().getHours(); // Get the current hour
|
||||
let time = 'مساء الخير'; // Set the default time string to "Good evening"
|
||||
if (hour < 12) time = 'صباح الخير'; // If it's before 12am, set the time string to "Good morning"
|
||||
else if (hour > 20) time = 'مساء الخير'; // If it's after 6pm, set the time string to "Good afternoon"
|
||||
setHTMLContent('.greeting', time); // Write the string contents to the HTML
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue