VirtualBox

Changeset 25114 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 30, 2009 4:25:33 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
55484
Message:

FE/Qt4-NLS: Add an English translation file for the plural forms

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r24672 r25114  
    635635VirtualBox.lproj_INST = $(INST_VIRTUALBOX)Contents/Resources/
    636636VirtualBox.lproj_MODE = 755
    637 VirtualBox.lproj_DIRS := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES_ALL))
     637VirtualBox.lproj_DIRS := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES))
    638638
    639639#
     
    742742# languages and should never be actually translated or installed.
    743743#
    744 updatenls:: \
     744updatenls:: makeallnls nls/VirtualBox_en.ts
     745
     746makeallnls:: \
    745747                $(filter-out %.qrc,$(VirtualBox_SOURCES) $(VirtualBox_VBOX_EXTRA_NLS_SOURCES)) \
    746748                $(wildcard include/*.h)
     
    749751                $^ \
    750752                -ts \
    751                 $(filter-out nls/qt_%.ts,$(VirtualBox_QT_TRANSLATIONS)) \
     753                $(filter-out nls/VirtualBox_en.ts,$(filter-out nls/qt_%.ts,$(VirtualBox_QT_TRANSLATIONS))) \
    752754                nls/VirtualBox_xx_YY.ts
    753755
     756# Create the English translation file. This is something special cause it will
     757# contain the plural forms only.
     758nls/VirtualBox_en.ts: \
     759                $(filter-out %.qrc,$(VirtualBox_SOURCES) $(VirtualBox_VBOX_EXTRA_NLS_SOURCES)) \
     760                $(wildcard include/*.h)
     761        $(call MSG_L1,lupdate $@)
     762        $(QUIET)$(TOOL_QT4_LUPDATE) \
     763                $^ \
     764                -ts \
     765                $@
     766        $(QUIET)$(SED) -n -i -e \
     767                '/<context>/,/<\/context>/!p;/<context>/h;/<name>/H;/<message numerus="yes">/,/<\/message>/H;/<\/context>/{H;x;/<message/p}' \
     768        $@
     769
  • trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro

    r24724 r25114  
    6262
    6363TRANSLATIONS = \
     64        nls/VirtualBox_en.ts \
    6465        nls/VirtualBox_el.ts \
    6566        nls/VirtualBox_tr.ts \
  • trunk/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk

    r24726 r25114  
    2020#
    2121
    22 # The list of approved GUI languages without 'en' (English).
     22# The list of approved GUI languages.
    2323VBOX_APPROVED_GUI_LANGUAGES := \
     24        en \
    2425        de    \
    2526        zh_TW \
     
    5152        da
    5253
    53 # The list of approved GUI languages including the default 'en'.
    54 VBOX_APPROVED_GUI_LANGUAGES_ALL := en $(VBOX_APPROVED_GUI_LANGUAGES)
    55 
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGLSettingsLanguage.cpp

    r24054 r25114  
    241241            continue;
    242242
     243        /* Skip any English version, cause this is extra handled. */
     244        QString lang = regExp.cap (2);
     245        if (lang.toLower() == "en")
     246            continue;
     247
    243248        bool loadOk = translator.load (fileName, nlsPath);
    244249        if (!loadOk)
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r25020 r25114  
    29422942    QString selectedLangId = gVBoxBuiltInLangName;
    29432943
     2944    /* If C is selected we change it temporary to en. This makes sure any extra
     2945     * "en" translation file will be loaded. This is necessary for loading the
     2946     * plural forms of some of our translations. */
     2947    bool fResetToC = false;
     2948    if (langId == "C")
     2949    {
     2950        langId = "en";
     2951        fResetToC = true;
     2952    }
     2953
    29442954    char szNlsPath[RTPATH_MAX];
    29452955    int rc;
     
    29782988             * case, if no explicit language file exists, we will simply
    29792989             * fall-back to English (built-in). */
    2980             if (!aLangId.isNull())
     2990            if (!aLangId.isNull() && langId != "en")
    29812991                vboxProblem().cannotFindLanguage (langId, nlsPath);
    29822992            /* selectedLangId remains built-in here */
     
    30493059        if (qtTr && (loadOk = qtTr->load (languageFileName)))
    30503060            qApp->installTranslator (qtTr);
    3051         /* The below message doesn't fit 100% (because it's an additonal
     3061        /* The below message doesn't fit 100% (because it's an additional
    30523062         * language and the main one won't be reset to built-in on failure)
    30533063         * but the load failure is so rare here that it's not worth a separate
     
    30563066            vboxProblem().cannotLoadLanguage (languageFileName);
    30573067    }
     3068    if (fResetToC)
     3069        sLoadedLangId = "C";
    30583070}
    30593071
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette