Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

multi-country-languages support in visual c++

how to make an application which support multi-country-languages in visual c++ ? i'd like to allow the user to change the language in runtime mode by checking an item in a menu and i'd like changes to occur immediately.

Comments

  • chick80chick80 Member Posts: 349
    First of all, if you have resources, like menu, dialogs etc. create a copy with the same ID, but with another language (you find it in the properties).
    Then you can use something like this:
    [code]
    LCID lang;

    // language stores the user's language choice.
    // for example 0 = english, 1 = italian
    switch(language)
    {
    case 0:
    lang = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
    break;
    case 1:
    lang = MAKELCID(MAKELANGID(LANG_ITALIAN, SUBLANG_ITALIAN), SORT_DEFAULT);
    break;
    }

    SetThreadLocale(lang);
    [/code]
    Note that if you want to update menus at run-time, you'll have to reload them!
    So use something like this:
    [code]
    SetMenu(hWnd, LoadMenu(hInst, MAKEINTRESOURCE(IDR_MENU)));
    [/code]

    bye
    nICO

    [hr]
    [italic]How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.[/italic]
    JOHN KEATS


  • Justin BibJustin Bib USAMember Posts: 0

    ____ [ http://forcoder.org ] free video tutorials and ebooks about { Ruby Perl Swift JavaScript C Visual Basic R MATLAB C++ Scratch PHP Python Go Assembly C# Java PL/SQL Delphi Visual Basic .NET Objective-C Julia VBScript Bash Prolog Scala Logo SAS ABAP Apex Lua Lisp Rust D Scheme Dart Kotlin Awk Ada Erlang FoxPro Clojure Hack ML Transact-SQL COBOL F# LabVIEW Alice Crystal Fortran } _______

Sign In or Register to comment.