×
Namespaces

Variants
Actions

Generating TBUF resources automatically

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: jsakkinen (15 Apr 2008)
Last edited: hamishwillee (23 Jul 2012)

The following sed-script generates TBUF-resources from file containing localized strings:

# If the line doesn't contain string declaration, skip it.
/STRING_r_/!d
 
# Strip prefix.
s/.*STRING_r_//
 
# Strip postfix.
s/\(\w*\).*/\1/
 
# Substitute to the TBUF declaration.
s/\(.*\)/RESOURCE TBUF r_\1 { buf = STRING_r_\1; }/

This script assumes that those strings that are meant to be declared as string resources are prefixed with STRING_r_.

For example, if you have rls-file:

//d:Foo
rls_string STRING_foo_heading "Foo"
 
//d:Bar
rls_string STRING_r_bar_heading "Bar"

The generated strings.rss will contain:

RESOURCE TBUF r_bar_heading { buf = STRING_r_bar_heading; }
This page was last modified on 23 July 2012, at 10:51.
14 page views in the last 30 days.