lib/main.js
function localizeChapterTitle(language_slug, chapter_number) {
    var translations = {
        'ar': 'الفصل %',
        'en': 'Chapter %',
        'ru': 'Глава %',
        'hu': '%. fejezet',
        'sr-Latin': 'Поглавље %',
        'default': 'Chapter %'
    };
    var title = translations[language_slug];
    if(!title) title = translations['default'];
    var num = parseInt(chapter_number);
    if (isNaN(num)) num = chapter_number;
    return title.replace('%', num);
}
function localizeChapterTitle(language_slug, chapter_number) {
    var translations = {
        'ar': 'الفصل %',
        'en': 'Chapter %',
        'ru': 'Глава %',
        'hu': '%. fejezet',
        'sr-Latin': 'Поглавље %',
        'default': 'Chapter %'
    };
    var title = translations[language_slug];
    if(!title) title = translations['default'];
    var num = parseInt(chapter_number);
    if (isNaN(num)) num = chapter_number;
    return title.replace('%', num);
}
Returns a localized chapter title. e.g. "Chapter 1"
If the language does not have a match a default localization will be used.

If chapter_number is a number it will be parsed as an int to strip leading 0's

@param language_slug the language into which the chapter title will be localized
@param chapter_number the chapter number that is being localized