IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Forms Discussion :

[C#] Application multilangue


Sujet :

Windows Forms

  1. #1
    Membre averti Avatar de Seth77
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2005
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 448
    Points : 410
    Points
    410
    Par défaut [C#] Application multilangue
    Salut

    Quel est la meilleur solution pour realiser une application multilangue ?
    Je pense avec les fichiers ressources ...


    thx @+

  2. #2
    Membre éclairé
    Avatar de shwin
    Profil pro
    Inscrit en
    Novembre 2003
    Messages
    568
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Novembre 2003
    Messages : 568
    Points : 777
    Points
    777
    Par défaut
    Citation Envoyé par Seth77
    Salut

    Quel est la meilleur solution pour realiser une application multilangue ?
    Je pense avec les fichiers ressources ...


    thx @+
    Bingo!! met ta form avec la propriété localizable!
    Remoting Context Matters
    Everything in this chapter is 100 percent undocumented. Reliance on these techniques is not supported by either Microsoft, the publisher, or the author of this book. Use at you own risk! If your computer won't work afterwards, your toaster blows up or your car doesn't start, I assume no liability whatsoever: You're now about to enter the uncharted territories of .NET and you do so on your own risk. I can only provide some guidance

  3. #3
    Rédacteur
    Avatar de Thomas Lebrun
    Profil pro
    Inscrit en
    Octobre 2002
    Messages
    9 161
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France

    Informations forums :
    Inscription : Octobre 2002
    Messages : 9 161
    Points : 19 434
    Points
    19 434

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    349
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations forums :
    Inscription : Avril 2006
    Messages : 349
    Points : 320
    Points
    320
    Par défaut
    Citation Envoyé par Morpheus
    +1, un très bon tuto, clair et concis.
    J'ai fait ma première application localisée grâce à lui. Au passage merci Morpheus

    ++
    Le problème est souvent entre la chaise et le clavier

  5. #5
    Membre averti Avatar de Seth77
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2005
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 448
    Points : 410
    Points
    410
    Par défaut
    Merci tlm !

  6. #6
    Membre averti Avatar de Seth77
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2005
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 448
    Points : 410
    Points
    410
    Par défaut
    J'ai regarde le tuto... il y a un truc que je ne comprends pas ....
    on a donc un fichier ressource pour chaque langue et pour chaque form...


    on doit donc avoir un ResourceManager par form ?
    et comment faire un fichier ressource qui n'est pas rattache a une form ?

  7. #7
    Membre averti Avatar de Seth77
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2005
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 448
    Points : 410
    Points
    410
    Par défaut
    up

  8. #8
    Membre averti Avatar de Seth77
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2005
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 448
    Points : 410
    Points
    410
    Par défaut
    Personne pour eclairer ma lanterne ?

  9. #9
    Membre averti
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    349
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations forums :
    Inscription : Avril 2006
    Messages : 349
    Points : 320
    Points
    320
    Par défaut
    Ben en fait mon application (de test) n'avait qu'une seule form...

    Morpheus pourra peut-être te renseigner (et moi aussi par la même occasion )

    ++
    Le problème est souvent entre la chaise et le clavier

  10. #10
    Membre averti Avatar de Seth77
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2005
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 448
    Points : 410
    Points
    410
    Par défaut
    J'arrive pas a voir le code qui est derriere le fichier resx du tuto ....

  11. #11
    Rédacteur
    Avatar de Thomas Lebrun
    Profil pro
    Inscrit en
    Octobre 2002
    Messages
    9 161
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France

    Informations forums :
    Inscription : Octobre 2002
    Messages : 9 161
    Points : 19 434
    Points
    19 434
    Par défaut
    Attention, ce tuto est valable pour du .NET 1.0 / 1.1

    En .NET 2, vous pouvez passer directement par les ressources

  12. #12
    Membre averti Avatar de Seth77
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2005
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 448
    Points : 410
    Points
    410
    Par défaut
    Citation Envoyé par Morpheus
    Attention, ce tuto est valable pour du .NET 1.0 / 1.1

    En .NET 2, vous pouvez passer directement par les ressources
    ah d'accord...

    si j'ai bien compris il faut tout de meme mettre a jour tout les labels de tout les composants manuellement ?
    et comment gerer le fait de passer d'un fichier ressource a l'autre en fonction de la langue choisie ?


  13. #13
    Membre averti Avatar de Seth77
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2005
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 448
    Points : 410
    Points
    410
    Par défaut
    up

  14. #14
    Membre habitué Avatar de LaNat
    Profil pro
    Inscrit en
    Avril 2005
    Messages
    162
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Bas Rhin (Alsace)

    Informations forums :
    Inscription : Avril 2005
    Messages : 162
    Points : 164
    Points
    164
    Par défaut
    Il me semble que c'est
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

  15. #15
    Membre averti Avatar de Seth77
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2005
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 448
    Points : 410
    Points
    410
    Par défaut
    Citation Envoyé par LaNat
    Il me semble que c'est
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");


    Ben alors comment faire le lien entre mon fichier ressource et System.Threading.Thread.CurrentThread.CurrentCulture ?

  16. #16
    Membre habitué Avatar de LaNat
    Profil pro
    Inscrit en
    Avril 2005
    Messages
    162
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Bas Rhin (Alsace)

    Informations forums :
    Inscription : Avril 2005
    Messages : 162
    Points : 164
    Points
    164
    Par défaut
    Je pense que c'est le RessourceManager qui se débrouille comme un grand (arrêtez moi si je dis des conneries!!)

  17. #17
    Membre averti Avatar de Seth77
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2005
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 448
    Points : 410
    Points
    410
    Par défaut
    Ben chepa ca doit etre moi ...

    Si je cree 2 fichiers ressources

    fichier1.resx
    fichier2.resx

    Comment sait il quel fichier ressouce prendre si je lui dit :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    CultureInfo FrenchCulture = new CultureInfo("fr-FR");
    System.Threading.Thread.CurrentThread.CurrentUICulture = FrenchCulture;

  18. #18
    Membre habitué Avatar de LaNat
    Profil pro
    Inscrit en
    Avril 2005
    Messages
    162
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Bas Rhin (Alsace)

    Informations forums :
    Inscription : Avril 2005
    Messages : 162
    Points : 164
    Points
    164
    Par défaut
    Là je crois qu'il vaut mieux que je laisse la parole aux autres lol

  19. #19
    En attente de confirmation mail
    Inscrit en
    Août 2006
    Messages
    550
    Détails du profil
    Informations personnelles :
    Âge : 49

    Informations forums :
    Inscription : Août 2006
    Messages : 550
    Points : 669
    Points
    669
    Par défaut
    Et si tu nommes tes fichiers comme ceci :

    #NomDuForm#.en.resx
    #NomDuForm#.fr.resx

  20. #20
    Membre averti Avatar de Seth77
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Octobre 2005
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 448
    Points : 410
    Points
    410
    Par défaut
    Citation Envoyé par Kelpan
    Et si tu nommes tes fichiers comme ceci :

    #NomDuForm#.en.resx
    #NomDuForm#.fr.resx
    Oui, mais si je ne veux pas rattache mes fichiers ressources a une form ...

Discussions similaires

  1. [WD10] Application multilangue
    Par zannoubia dans le forum WinDev
    Réponses: 1
    Dernier message: 03/04/2010, 19h47
  2. Réponses: 5
    Dernier message: 04/12/2006, 22h40
  3. [WebForms]Application multilangue avec Images
    Par steelidol dans le forum Général Dotnet
    Réponses: 2
    Dernier message: 13/04/2006, 14h37
  4. Application multilangue
    Par xave dans le forum MFC
    Réponses: 9
    Dernier message: 24/02/2004, 13h53

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo