Fixed handling of \xNN in strings. This way it is possible to translate a string even if there is a B_UTF8_ELLIPSIS or some other weird char in it. Improves the bluetooth preflet translation :)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33341 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2009-09-28 21:39:49 +00:00
parent e6b7213cc2
commit 6bf3fe1f2e
5 changed files with 34 additions and 14 deletions

View File

@ -8,6 +8,9 @@
#include <ByteOrder.h>
#include <stdlib.h>
/*
* This is the standard implementation of a localization catalog, using a hash
* map. This class is abstract, you need to inherit it and provide methodes for
@ -160,7 +163,13 @@ parseQuotedChars(BString& stringToParse)
*out = '\t';
else if (*in == '"')
*out = '"';
else {
else if (*in == 'x') {
// Parse the 2-digit hex integer that follows
unsigned int hexchar = strtoul(in + 1, NULL, 16);
*out = hexchar;
// skip the number
in += 2;
} else {
// dump quote from unknown quoting-sequence:
*out = *in ;
}

View File

@ -1,7 +1,7 @@
1 french x-vnd.Haiku-BluetoothPrefs 1173425682
1 french x-vnd.Haiku-BluetoothPrefs 2566651844
About… Window À propos…
Handheld Settings view Appareil de poche
Only from Trusted devices Settings view Seulement les appareils de confiance
Refresh LocalDevicesxE2x80xA6 Window Rafraîchir LocalDevicexE2x80xA6
Add device to list Inquiry panel Ajouter l'appareil à la liste
Starting scan... Inquiry panel Démarrage de la recherche...
Smart Phone Settings view Téléphone
@ -11,28 +11,25 @@ Server Settings view Serveur
Default Inquiry time: Settings view Temps de requête par défaut:
Identify host as: Settings view Identifier l'hôte comme :
View Window Vue
Show Bluetooth consolexE2x80xA6 Window Montrer le terminal bluetoothxE2x80xA6
Refresh… Remote devices Rafraîchir…
Show Bluetooth console… Window Montrer le terminal bluetooth…
Incoming connections policy: Settings view Attitude envers les connexions entrantes :
From all devices Settings view Tous les appareils
RefreshxE2x80xA6 Remote devices RafraîchirxE2x80xA6
Connections & Channels listxE2x80xA6 Window Liste des connexions et canauxxE2x80xA6
Start Bluetooth Services… Window Démarrer les services bluetooth…
Server Window Serveur
Scanning completed. Inquiry panel Recherche complète.
Start Bluetooth ServicesxE2x80xA6 Window Démarrer les services bluetoothxE2x80xA6
Remove Remote devices Enlever
15 secs Settings view 15 secs
Policy... Settings view Attitude...
61 secs Settings view 61 secs
AddxE2x80xA6 Remote devices AjouterxE2x80xA6
Identify us as... Settings view S'identifier comme...
Remaining Inquiry panel Restant
Connections & Channels list… Window Liste des canaux et connexions…
Pick LocalDevice... Settings view Choisir LocalDevice...
Defaults Window Défauts
Inquiry Inquiry panel Requête
Desktop Settings view Bureau
Revert Window Défaire
AboutxE2x80xA6 Window À proposxE2x80xA6
Remote Devices ListxE2x80xA6 Window Liste d'appareils distantsxE2x80xA6
Laptop Settings view Portable
Retrieving name of Inquiry panel Récupérer le nom de
Local Devices found on system: Settings view Appareils locaux trouvés sur le système :
@ -40,12 +37,15 @@ As Trusted Remote devices Comme de confiance
Discoverable Extended local device view Découvrable
As Blocked Remote devices Comme bloqué
Service Classes: Device View Classes de services:
Stop Bluetooth ServicesxE2x80xA6 Window Arrêter les services bluetoothxE2x80xA6
Refresh LocalDevices… Window Rafraîchir les LocalDevices…
Settings Window Paramètres
Check that the bluetooth capabilities of your remote device are activated. Press Inquiry to start scanning. The needed time for the retrieval of the names is unknown, although should not take more than 3 seconds per device. Afterwards you will be able to add them to your main list, where you will be able to pair with them Inquiry panel Vérifiez que les fonctionnalités bluetooth de votre appareil distant sont activées. Appuyez sur "Requête" pour lancer la recherche. Le temps nécessaire pour récupérer les noms n'est pas connu, mais ça ne devrait pas prendre plus de 3 secondes par appareil. Ensuite vous pourrez les ajouter à la liste principale, où vous pourrez vous associer avec eux.
Scanning progress Inquiry panel Avancée de la recherche
Always ask Settings view Toujours demander
Remote Devices List… Window Liste des appareils distants…
Retrieving names... Inquiry panel Récupération des noms...
Help Window Aide
Add… Remote devices Ajouter…
There has not been found any bluetooth LocalDevice device registered on the system Inquiry panel Aucun matériel bluetooth trouvé sur le système
Stop Bluetooth Services… Window Arrêter les services bluetooth…
Show Name Extended local device view Montrer le nom

View File

@ -1,4 +1,4 @@
1 french x-vnd.Haiku-CPUFrequencyPref 1503797596
1 french x-vnd.Haiku-CPUFrequencyPref 2623066734
Ok Status view Ok
Integration Time [ms] CPU Frequency View Temps d'intégration [ms]
High Performance Status view Haute performance
@ -7,8 +7,8 @@ CPU Frequency Status View CPU Frequency View État de la fréquence du processe
Dynamic Performance Status view Performance dynamique
Step up by CPU usage: Color Step View Accélération par utilisation processeur:
Stepping Policy CPU Frequency View Attitude d'accélération
Open Speedstep Preferences… Status view Ouvrir les préférences Speestep…
Set State Status view Changer l'état
Open Speedstep PreferencesxE2x80xA6 Status view Préférences speedstepxE2x80xA6
Launching the CPU Frequency preflet failed.\n\nError: Status view Échec de lancement des préférences de fréquence du processeur.\n\nErreur:
Install Replicant into Deskbar CPU Frequency View Installer le réplicant dans la Deskbar
Low Energy Status view Basse consommation

View File

@ -8,6 +8,8 @@
#include <ByteOrder.h>
#include <stdlib.h>
/*
* This is the standard implementation of a localization catalog, using a hash
@ -161,7 +163,13 @@ parseQuotedChars(BString& stringToParse)
*out = '\t';
else if (*in == '"')
*out = '"';
else {
else if (*in == 'x') {
// Parse the 2-digit hex integer that follows
unsigned int hexchar = strtoul(in + 1, NULL, 16);
*out = hexchar;
// skip the number
in += 2;
} else {
// dump quote from unknown quoting-sequence:
*out = *in ;
}

View File

@ -51,6 +51,9 @@ static int16 kCatArchiveVersion = 1;
// version of the catalog archive structure, bump this if you change it!
// Note: \xNN is not replaced back, so you get the unescaped value in the catkey
// file. This is fine for regular unicode chars (B_UTF8_ELLIPSIS) but may be
// dangerous if you use \x10 as a newline...
void
escapeQuotedChars(BString& stringToEscape)
{