SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
Localisation d’applications
Pourquoi localiser ?

• Meilleure expérience utilisateur
• Plus de clients




                                                   8 %   17 %
                                             8 %
                                           7 %
     Irlande     Belgique      Grèce                            18 %
     Espagen     Autriche      Taiwan
     Russie      Turquie       Chili
     Equateur    Malaisie      Salvador
     Australie   Danemark      Portugal
     Pays Bas
     Suisse
                 Italie
                 Japon
                               Allemagne
                               France
                                                         19 %
     USA         Royaume Uni
Internationalisation

• NSNumberFormatter

    - (NSString *)stringFromNumber:(NSNumber *)number




                  $1,000.00    1 000,00 $
Internationalisation

• NSDateFormatter

    - (NSString *)stringFromDate:(NSDate *)date


                    - (void)setDoesRelativeDateFormatting:(BOOL)b
                    + (NSString *)dateFormatFromTemplate:
                    (NSString *)template options:(NSUInteger)opts
                    locale:(NSLocale *)locale
   !!"#$%&'&
 NSDateFormatter * dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
 NSString * dateComponents = @"yMMMMd";
 NSString * dateFormat = [NSDateFormatter dateFormatFromTemplate:dateComponents
 options:0 locale: [NSLocale currentLocale]];
 [dateFormatter setDateFormat:dateFormat];

                                         !

              September 9, 2010              9 Septembre 2010
Processus de localisation


 • Préparer la localisation

 • Traduire

 • Ajuster les élements d’interface
Localisation

• Fichiers .strings

    Encodage UTF-16

• Stockés sous forme key/value

    "clé" = "valeur";

• Accessibles avec :

    NSLocalizedString(@"Key", @"Localization hint");
    Fichier Localizable.strings
genstrings

• Outil pour scanner et produire un fichier .strings

• Insère les commentaires trouvés dans le code

• Accessible avec :

   genstrings ./*.m



   NSLocalizedString(@"Key", @"Localization hint");


     /* Localization hint */
     "Key" = "Clé";
XIBs localisés
Démo
Recommendations

• Utiliser des images le plus souvent possible




• Utiliser les variables “%1$@” pour permettre un ordre différent



   /* Message in alert panel when something fails */
   "Oh %@! %@ failed!" = "%2$@ blah blah, %1$@ oh!";
Recommendations
• Formattage des strings

  NSLocalizedString(@"reversedDomainStyleKey", @"'English
  translation' and localization hint");

 /* 'English translation' and localization hint */
 "reversedDomainStyleKey" = "reversedDomainStyleKey";


 /* 'Enter passcode' text when unlocking the application */
 "passCodeUnlockEnterPassCode" = "Saisissez le code";

 /* 'Wrong passcode' text when unlocking the application */
 "passCodeUnlockWrongPassCode" = "Code erroné";

 /* 'Numeric keypad' in the settings */
 "settingsNumericKeypad" = "Clavier numérique";

 /* 'Enter Decimals Automatically' in the settings */
 "settingsNumericKeypadEnterDecimalsAutomatically" = "Décimales automatiques";

 /* 'Use Decimal Key' in the settings */
 "settingsNumericKeypadUseDecimalKey" = "settingsNumericKeypadUseDecimalKey";
Recommendations

Eviter de localiser les XIBs
 • Maintenance difficile



Localiser dans le code
 • Traduire les labels, boutons, etc...

 • Ajuster les élements d’interface



Avantages
 • Résultat immédiat pour les traducteurs sous OS X

 • Taille de l’application réduite
Recommendations
- (void)loadView {
! [super loadView];
!
! [self sq_localizeControls];
! [self sq_layoutViewControls];
}



- (void)sq_localizeControls {
! accountsHistoryLabel.stringValue = NSLocalizedStringFromTable(@"accountsHistoryLabelTitle",
@"PreferencesCharts", @"'Accounts history:' title of the corresponding label");
!
! graphTypeLabel.stringValue = NSLocalizedStringFromTable(@"graphTypeLabelTitle", @"PreferencesCharts",
@"'Graph type:' title of the corresponding label");
! [graphTypePopUpButton addItemWithTitle:NSLocalizedStringFromTable
(@"graphTypePopUpButtonBalanceHistoryItemTitle", @"PreferencesCharts", @"'Balance history' title of the menu
item to display the balance history in the history graph")]; @"PreferencesCharts", @"'Activate rotation'
title of the checkbox button to activate the Z-axis rotation of the history graph");
    ...
}




NSLocalizedStringFromTable(@"Key", @"Table",
@"Localization hint");
Recommendations

!
- (void)sq_layoutViewControls {
    ...

     // Percentages button
!   [displayPercentageButton sizeToFit];
!   NSRect displayPercentageButtonFrame = displayPercentageButton.frame;
!   displayPercentageButtonFrame.origin.x = borderMargin + 20;
!   displayPercentageButton.frame = displayPercentageButtonFrame;
}




              (UIView)
              - sizeToFit;
iOS
              (UITextField & UILabel)
              @property(nonatomic) BOOL adjustsFontSizeToFitWidth;



              (NSControl)
OS X
              - sizeToFit;
Recommendations

 Vos traducteurs
    • Laissez-les vous contacter
    • Uniquement des natifs
    • Vérifiez leur «CV»
    • Intégrez-les à vos béta testeurs

Mais conteúdo relacionado

Destaque

Arbres del pati
Arbres del patiArbres del pati
Arbres del patibelen79
 
Rethink The Way You Invest Wealth Smart Version
Rethink The Way You Invest Wealth Smart VersionRethink The Way You Invest Wealth Smart Version
Rethink The Way You Invest Wealth Smart Versionvetter
 
Automatisation shipping process
Automatisation shipping processAutomatisation shipping process
Automatisation shipping processCocoaHeads.fr
 
Présentation gnireenigne
Présentation   gnireenignePrésentation   gnireenigne
Présentation gnireenigneCocoaHeads.fr
 
G I U S E P P E A R C I M B O L D O
G I U S E P P E  A R C I M B O L D OG I U S E P P E  A R C I M B O L D O
G I U S E P P E A R C I M B O L D Obelen79
 
Andy warhol
Andy warholAndy warhol
Andy warholbelen79
 
Wireless ad hoc distribution
Wireless ad hoc distributionWireless ad hoc distribution
Wireless ad hoc distributionCocoaHeads.fr
 
Investment Banking presentation
Investment Banking presentation Investment Banking presentation
Investment Banking presentation Ketan Likhite
 

Destaque (11)

Arbres del pati
Arbres del patiArbres del pati
Arbres del pati
 
Rethink The Way You Invest Wealth Smart Version
Rethink The Way You Invest Wealth Smart VersionRethink The Way You Invest Wealth Smart Version
Rethink The Way You Invest Wealth Smart Version
 
Automatisation shipping process
Automatisation shipping processAutomatisation shipping process
Automatisation shipping process
 
Présentation gnireenigne
Présentation   gnireenignePrésentation   gnireenigne
Présentation gnireenigne
 
Champion
ChampionChampion
Champion
 
G I U S E P P E A R C I M B O L D O
G I U S E P P E  A R C I M B O L D OG I U S E P P E  A R C I M B O L D O
G I U S E P P E A R C I M B O L D O
 
Slides de la
Slides de la Slides de la
Slides de la
 
Andy warhol
Andy warholAndy warhol
Andy warhol
 
Wireless ad hoc distribution
Wireless ad hoc distributionWireless ad hoc distribution
Wireless ad hoc distribution
 
Adbms lab manual
Adbms lab manualAdbms lab manual
Adbms lab manual
 
Investment Banking presentation
Investment Banking presentation Investment Banking presentation
Investment Banking presentation
 

Semelhante a Slides de la Localisation

Enib cours c.a.i. web - séance #1 - html5 css3-js - 2
Enib   cours c.a.i. web - séance #1 - html5 css3-js - 2Enib   cours c.a.i. web - séance #1 - html5 css3-js - 2
Enib cours c.a.i. web - séance #1 - html5 css3-js - 2Horacio Gonzalez
 
MyBatis, une alternative à JPA.
MyBatis, une alternative à JPA.MyBatis, une alternative à JPA.
MyBatis, une alternative à JPA.Kokou Gaglo
 
Cocoaheads Rennes #3 : Bien coder sur iOS
Cocoaheads Rennes #3 : Bien coder sur iOSCocoaheads Rennes #3 : Bien coder sur iOS
Cocoaheads Rennes #3 : Bien coder sur iOSCocoaHeadsRNS
 
CocoaHeads Rennes #13 : Magical Record
CocoaHeads Rennes #13 : Magical RecordCocoaHeads Rennes #13 : Magical Record
CocoaHeads Rennes #13 : Magical RecordCocoaHeadsRNS
 
Découverte du moteur de rendu du projet Spartan
Découverte du moteur de rendu du projet SpartanDécouverte du moteur de rendu du projet Spartan
Découverte du moteur de rendu du projet SpartanMicrosoft
 
Data Mining (Partie 2).pdf
Data Mining (Partie 2).pdfData Mining (Partie 2).pdf
Data Mining (Partie 2).pdfOuailChoukhairi
 
Internationalisation du Front
Internationalisation du FrontInternationalisation du Front
Internationalisation du FrontYannick Croissant
 
Voxxdays luxembourg 2016 retours java 8
Voxxdays luxembourg 2016 retours java 8Voxxdays luxembourg 2016 retours java 8
Voxxdays luxembourg 2016 retours java 8Jean-Michel Doudoux
 
Développement Web - HTML5, CSS3, APIs Web
Développement Web - HTML5, CSS3, APIs WebDéveloppement Web - HTML5, CSS3, APIs Web
Développement Web - HTML5, CSS3, APIs WebYoann Gotthilf
 
Symfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 PerformantSymfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 PerformantHugo Hamon
 
E-Metrics Paris 2011 - Libérer l'action pour faire bondir sa transfo
E-Metrics Paris 2011 - Libérer l'action pour faire bondir sa transfoE-Metrics Paris 2011 - Libérer l'action pour faire bondir sa transfo
E-Metrics Paris 2011 - Libérer l'action pour faire bondir sa transfoThomas TONDER
 
Softshake 2013 Apiness SA l'envers du décor
Softshake 2013 Apiness SA l'envers du décorSoftshake 2013 Apiness SA l'envers du décor
Softshake 2013 Apiness SA l'envers du décormichaelmiguel2013
 
Softshake apiness l'envers du décor
Softshake apiness l'envers du décorSoftshake apiness l'envers du décor
Softshake apiness l'envers du décorApinessSA
 
Java 5, un blian
Java 5, un blianJava 5, un blian
Java 5, un bliantareq
 
Java 5, un bilan
Java 5,  un bilanJava 5,  un bilan
Java 5, un bilanteejug
 

Semelhante a Slides de la Localisation (20)

Enib cours c.a.i. web - séance #1 - html5 css3-js - 2
Enib   cours c.a.i. web - séance #1 - html5 css3-js - 2Enib   cours c.a.i. web - séance #1 - html5 css3-js - 2
Enib cours c.a.i. web - séance #1 - html5 css3-js - 2
 
MyBatis, une alternative à JPA.
MyBatis, une alternative à JPA.MyBatis, une alternative à JPA.
MyBatis, une alternative à JPA.
 
Cocoaheads Rennes #3 : Bien coder sur iOS
Cocoaheads Rennes #3 : Bien coder sur iOSCocoaheads Rennes #3 : Bien coder sur iOS
Cocoaheads Rennes #3 : Bien coder sur iOS
 
Pg jsonb format 16-9
Pg jsonb format 16-9Pg jsonb format 16-9
Pg jsonb format 16-9
 
A13 big data et web sémantique
A13  big data et web sémantiqueA13  big data et web sémantique
A13 big data et web sémantique
 
CocoaHeads Rennes #13 : Magical Record
CocoaHeads Rennes #13 : Magical RecordCocoaHeads Rennes #13 : Magical Record
CocoaHeads Rennes #13 : Magical Record
 
Découverte du moteur de rendu du projet Spartan
Découverte du moteur de rendu du projet SpartanDécouverte du moteur de rendu du projet Spartan
Découverte du moteur de rendu du projet Spartan
 
Data Mining (Partie 2).pdf
Data Mining (Partie 2).pdfData Mining (Partie 2).pdf
Data Mining (Partie 2).pdf
 
Internationalisation du Front
Internationalisation du FrontInternationalisation du Front
Internationalisation du Front
 
Formulaires
FormulairesFormulaires
Formulaires
 
Voxxdays luxembourg 2016 retours java 8
Voxxdays luxembourg 2016 retours java 8Voxxdays luxembourg 2016 retours java 8
Voxxdays luxembourg 2016 retours java 8
 
4-TP BD.pptx
4-TP BD.pptx4-TP BD.pptx
4-TP BD.pptx
 
Introduction à TileMill
Introduction à TileMillIntroduction à TileMill
Introduction à TileMill
 
Développement Web - HTML5, CSS3, APIs Web
Développement Web - HTML5, CSS3, APIs WebDéveloppement Web - HTML5, CSS3, APIs Web
Développement Web - HTML5, CSS3, APIs Web
 
Symfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 PerformantSymfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 Performant
 
E-Metrics Paris 2011 - Libérer l'action pour faire bondir sa transfo
E-Metrics Paris 2011 - Libérer l'action pour faire bondir sa transfoE-Metrics Paris 2011 - Libérer l'action pour faire bondir sa transfo
E-Metrics Paris 2011 - Libérer l'action pour faire bondir sa transfo
 
Softshake 2013 Apiness SA l'envers du décor
Softshake 2013 Apiness SA l'envers du décorSoftshake 2013 Apiness SA l'envers du décor
Softshake 2013 Apiness SA l'envers du décor
 
Softshake apiness l'envers du décor
Softshake apiness l'envers du décorSoftshake apiness l'envers du décor
Softshake apiness l'envers du décor
 
Java 5, un blian
Java 5, un blianJava 5, un blian
Java 5, un blian
 
Java 5, un bilan
Java 5,  un bilanJava 5,  un bilan
Java 5, un bilan
 

Mais de CocoaHeads.fr

Mais de CocoaHeads.fr (9)

Hello xcode 4 v2
Hello xcode 4 v2Hello xcode 4 v2
Hello xcode 4 v2
 
Mac app store redux
Mac app store reduxMac app store redux
Mac app store redux
 
Déploiement ad hoc et beta test
Déploiement ad hoc et beta testDéploiement ad hoc et beta test
Déploiement ad hoc et beta test
 
Bitmaps
BitmapsBitmaps
Bitmaps
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Presentation de Mars
Presentation de MarsPresentation de Mars
Presentation de Mars
 
Presentation de Mars
Presentation de MarsPresentation de Mars
Presentation de Mars
 
Presentation de Mars
Presentation de MarsPresentation de Mars
Presentation de Mars
 

Slides de la Localisation

  • 2. Pourquoi localiser ? • Meilleure expérience utilisateur • Plus de clients 8 % 17 % 8 % 7 % Irlande Belgique Grèce 18 % Espagen Autriche Taiwan Russie Turquie Chili Equateur Malaisie Salvador Australie Danemark Portugal Pays Bas Suisse Italie Japon Allemagne France 19 % USA Royaume Uni
  • 3.
  • 4.
  • 5. Internationalisation • NSNumberFormatter - (NSString *)stringFromNumber:(NSNumber *)number $1,000.00 1 000,00 $
  • 6. Internationalisation • NSDateFormatter - (NSString *)stringFromDate:(NSDate *)date - (void)setDoesRelativeDateFormatting:(BOOL)b + (NSString *)dateFormatFromTemplate: (NSString *)template options:(NSUInteger)opts locale:(NSLocale *)locale !!"#$%&'& NSDateFormatter * dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; NSString * dateComponents = @"yMMMMd"; NSString * dateFormat = [NSDateFormatter dateFormatFromTemplate:dateComponents options:0 locale: [NSLocale currentLocale]]; [dateFormatter setDateFormat:dateFormat]; ! September 9, 2010 9 Septembre 2010
  • 7. Processus de localisation • Préparer la localisation • Traduire • Ajuster les élements d’interface
  • 8. Localisation • Fichiers .strings Encodage UTF-16 • Stockés sous forme key/value "clé" = "valeur"; • Accessibles avec : NSLocalizedString(@"Key", @"Localization hint"); Fichier Localizable.strings
  • 9. genstrings • Outil pour scanner et produire un fichier .strings • Insère les commentaires trouvés dans le code • Accessible avec : genstrings ./*.m NSLocalizedString(@"Key", @"Localization hint"); /* Localization hint */ "Key" = "Clé";
  • 11. Démo
  • 12. Recommendations • Utiliser des images le plus souvent possible • Utiliser les variables “%1$@” pour permettre un ordre différent /* Message in alert panel when something fails */ "Oh %@! %@ failed!" = "%2$@ blah blah, %1$@ oh!";
  • 13. Recommendations • Formattage des strings NSLocalizedString(@"reversedDomainStyleKey", @"'English translation' and localization hint"); /* 'English translation' and localization hint */ "reversedDomainStyleKey" = "reversedDomainStyleKey"; /* 'Enter passcode' text when unlocking the application */ "passCodeUnlockEnterPassCode" = "Saisissez le code"; /* 'Wrong passcode' text when unlocking the application */ "passCodeUnlockWrongPassCode" = "Code erroné"; /* 'Numeric keypad' in the settings */ "settingsNumericKeypad" = "Clavier numérique"; /* 'Enter Decimals Automatically' in the settings */ "settingsNumericKeypadEnterDecimalsAutomatically" = "Décimales automatiques"; /* 'Use Decimal Key' in the settings */ "settingsNumericKeypadUseDecimalKey" = "settingsNumericKeypadUseDecimalKey";
  • 14. Recommendations Eviter de localiser les XIBs • Maintenance difficile Localiser dans le code • Traduire les labels, boutons, etc... • Ajuster les élements d’interface Avantages • Résultat immédiat pour les traducteurs sous OS X • Taille de l’application réduite
  • 15. Recommendations - (void)loadView { ! [super loadView]; ! ! [self sq_localizeControls]; ! [self sq_layoutViewControls]; } - (void)sq_localizeControls { ! accountsHistoryLabel.stringValue = NSLocalizedStringFromTable(@"accountsHistoryLabelTitle", @"PreferencesCharts", @"'Accounts history:' title of the corresponding label"); ! ! graphTypeLabel.stringValue = NSLocalizedStringFromTable(@"graphTypeLabelTitle", @"PreferencesCharts", @"'Graph type:' title of the corresponding label"); ! [graphTypePopUpButton addItemWithTitle:NSLocalizedStringFromTable (@"graphTypePopUpButtonBalanceHistoryItemTitle", @"PreferencesCharts", @"'Balance history' title of the menu item to display the balance history in the history graph")]; @"PreferencesCharts", @"'Activate rotation' title of the checkbox button to activate the Z-axis rotation of the history graph"); ... } NSLocalizedStringFromTable(@"Key", @"Table", @"Localization hint");
  • 16. Recommendations ! - (void)sq_layoutViewControls { ... // Percentages button ! [displayPercentageButton sizeToFit]; ! NSRect displayPercentageButtonFrame = displayPercentageButton.frame; ! displayPercentageButtonFrame.origin.x = borderMargin + 20; ! displayPercentageButton.frame = displayPercentageButtonFrame; } (UIView) - sizeToFit; iOS (UITextField & UILabel) @property(nonatomic) BOOL adjustsFontSizeToFitWidth; (NSControl) OS X - sizeToFit;
  • 17. Recommendations Vos traducteurs • Laissez-les vous contacter • Uniquement des natifs • Vérifiez leur «CV» • Intégrez-les à vos béta testeurs