QString ApplicationInfo::getLocaleFilePath(const QString &file)
{
    QString localeShortName = localeShort();

    QString filename = file;
    filename.replace("$LOCALE", localeShortName);
    return filename;
}
Beispiel #2
0
QString ApplicationInfo::getAudioFilePath(const QString &file)
{
    QString localeShortName = localeShort();

    QString filename = file;
    filename.replace("$LOCALE", localeShortName);
    return getResourceDataPath() + "/" + filename;
}
// return the shortest possible locale name for the given locale, describing
// a unique voices dataset
QString ApplicationInfo::getVoicesLocale(const QString &locale)
{
    QString _locale = locale;
    if(_locale == GC_DEFAULT_LOCALE) {
        _locale = QLocale::system().name();
        if(_locale == "C")
            _locale = "en_US";
    }
    // locales we have country-specific voices for:
    if (_locale.startsWith(QLatin1String("pt_BR")) ||
        _locale.startsWith(QLatin1String("zh_CN")) ||
        _locale.startsWith(QLatin1String("zh_TW")))
        return QLocale(_locale).name();
    // short locale for all the rest:
    return localeShort(_locale);
}