Fixed small bug with parsing plurals
This commit is contained in:
@@ -219,7 +219,6 @@ errorret_t assetLocaleGetString(
|
||||
sizeof(msgidPluralBuffer)
|
||||
);
|
||||
msgidPluralFound = true;
|
||||
printf("Found plural ID: %s\n", msgidPluralBuffer);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -252,8 +251,17 @@ errorret_t assetLocaleGetString(
|
||||
|
||||
int32_t index = atoi(ptr);
|
||||
if(index != pluralIndex) {
|
||||
// Not the plural form we want, skip
|
||||
// Not the plural form we want, skip to the next useable line
|
||||
while(!reader.eof) {
|
||||
errorChain(assetFileLineReaderNext(&reader));
|
||||
errorChain(assetLocaleLineSkipBlanks(&reader, lineBuffer));
|
||||
if(
|
||||
lineBuffer[0] == '\"' ||
|
||||
lineBuffer[0] == '\0' ||
|
||||
lineBuffer[0] == '#'
|
||||
) continue;
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -273,6 +281,5 @@ errorret_t assetLocaleGetString(
|
||||
errorThrow("Failed to find msgstr for message ID: %s", messageId);
|
||||
}
|
||||
|
||||
printf("Found translation: %s\n", stringBuffer);
|
||||
errorOk();
|
||||
}
|
||||
@@ -41,13 +41,14 @@ errorret_t engineInit(const int32_t argc, const char_t **argv) {
|
||||
|
||||
char_t buffer[256];
|
||||
errorChain(localeManagerGetText(
|
||||
"error.upload_failed.long",
|
||||
"user.invite_status",
|
||||
buffer,
|
||||
sizeof(buffer),
|
||||
0,
|
||||
"Test File Name"
|
||||
2,
|
||||
"Dominic",
|
||||
2
|
||||
));
|
||||
printf("Retrieved localized string: %s\n", buffer);
|
||||
assertUnreachable(buffer);
|
||||
|
||||
// Run the initial script.
|
||||
scriptcontext_t ctx;
|
||||
|
||||
Reference in New Issue
Block a user