slides de la localisation
DESCRIPTION
TRANSCRIPT
![Page 1: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/1.jpg)
Localisation d’applications
![Page 2: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/2.jpg)
•Plus de clients•Meilleure expérience utilisateur
Pourquoi localiser ?
19 %
18 %
17 %8 %8 %
7 %Irlande Belgique GrèceEspagen Autriche TaiwanRussie Turquie ChiliEquateur Malaisie SalvadorAustralie Danemark PortugalPays Bas Italie AllemagneSuisse Japon FranceUSA Royaume Uni
![Page 3: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/3.jpg)
![Page 4: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/4.jpg)
![Page 5: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/5.jpg)
Internationalisation
•NSNumberFormatter
- (NSString *)stringFromNumber:(NSNumber *)number
$1,000.00 1 000,00 $
![Page 6: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/6.jpg)
•NSDateFormatter
Internationalisation
- (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
![Page 7: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/7.jpg)
Processus de localisation
•Préparer la localisation•Traduire•Ajuster les élements d’interface
![Page 8: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/8.jpg)
Localisation
•Fichiers .strings
•Stockés sous forme key/value
•Accessibles avec :
"clé" = "valeur";
NSLocalizedString(@"Key", @"Localization hint");Fichier Localizable.strings
Encodage UTF-16
![Page 9: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/9.jpg)
•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é";
genstrings
![Page 10: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/10.jpg)
XIBs localisés
![Page 11: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/11.jpg)
Démo
![Page 12: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/12.jpg)
•Utiliser des images le plus souvent possible
Recommendations
•Utiliser les variables “%1$@” pour permettre un ordre différent
/* Message in alert panel when something fails */"Oh %@! %@ failed!" = "%2$@ blah blah, %1$@ oh!";
![Page 13: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/13.jpg)
•Formattage des strings
NSLocalizedString(@"reversedDomainStyleKey", @"'English translation' and localization hint");
/* 'English translation' and localization hint */"reversedDomainStyleKey" = "reversedDomainStyleKey";
Recommendations
/* '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";
![Page 14: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/14.jpg)
Eviter de localiser les XIBs•Maintenance difficile
Localiser dans le code•Traduire les labels, boutons, etc...•Ajuster les élements d’interface
Recommendations
Avantages•Résultat immédiat pour les traducteurs sous OS X•Taille de l’application réduite
![Page 15: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/15.jpg)
- (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
![Page 16: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/16.jpg)
!- (void)sq_layoutViewControls {
...
// Percentages button! [displayPercentageButton sizeToFit];! NSRect displayPercentageButtonFrame = displayPercentageButton.frame;! displayPercentageButtonFrame.origin.x = borderMargin + 20;! displayPercentageButton.frame = displayPercentageButtonFrame;}
- sizeToFit;
Recommendations
iOS
OS X
@property(nonatomic) BOOL adjustsFontSizeToFitWidth;
- sizeToFit;
(UITextField & UILabel)
(NSControl)
(UIView)
![Page 17: Slides de la Localisation](https://reader033.vdocuments.fr/reader033/viewer/2022051515/54c4540c4a7959eb2b8b4594/html5/thumbnails/17.jpg)
Recommendations
Vos traducteurs
•Laissez-les vous contacter•Uniquement des natifs•Vérifiez leur «CV»• Intégrez-les à vos béta testeurs