1
0
Fork 0
forked from len0rd/rockbox

new skin tag: %Sx|<english>| will display the current languages translation of the "<english>" string.

the <english> is the Source: bit in the .lang files. (must be exactly as it is there...)

checkwps cannot verify that the string is correct so make sure to use the sim to verify the string is acurate.

Also "fix" checkwps so %St|<setting>| can be accepted for the theme site


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22837 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2009-09-26 00:58:32 +00:00
parent ba8fbb0b9b
commit 340f32356a
6 changed files with 64 additions and 18 deletions

View file

@ -98,3 +98,16 @@ int lang_load(const char *filename)
close(fd);
return retcode;
}
int lang_english_to_id(const char* english)
{
int i;
unsigned char *ptr = (unsigned char *) language_builtin;
for (i = 0; i < LANG_LAST_INDEX_IN_ARRAY; i++) {
if (!strcmp(ptr, english))
return i;
ptr += strlen((char *)ptr) + 1; /* advance pointer to next string */
}
return -1;
}