GL Strings supports placeholder conversion for both iOS and Android.
While they are identical to some degree, certain String Format Specifiers differ between iOS and Android. The placeholder conversion setting reduces the translation workload for projects where you want to share identically formatted strings across the two platforms.
This also allows you to use fewer projects on GL Strings or to maintain separate strings with the same content where only the placeholders differ.
This feature gives GL Strings users the ability to convert between iOS and Android placeholders during string export. Placeholder conversion on GL Strings allows users to replace multiple placeholders within the same string. We support conversion for both .string and .xml files only. The feature is available for manual export, the Android or iOS GL Strings SDKs, as well as the CLI integration option. See each integration documentation page for more information on how to enable placeholder conversion.
Android to iOS
%s
and %S
will be converted to %@
%h
and %tY
will convert to default %@
type.%b
and %B
will be converted to %@
%h
and %H
are converted to %@
<
are supported. Duke's Birthday: %1$tm %<te,%<tY
results in Duke's Birthday: %1$@ %1$@,%1$@
iOS to Android
%@
will be convert to %s
%s
%i
, %u
and %U
are converted to %d
%F
will be converted to %f
%s
remains %s
which will be used as Android String%p
iOS Pointer will be converted to Android integer %d
%O
Octal integer is converted to %o
%D
is converted to %d
Common Placeholders
These placeholders will not be converted as they are supported on both iOS and Android.
%e
and %E
%c
and %C
Unicode Characters%f
floating point number%g
and %G
computerized scientific notation%a
and %A
Floating point numbers%o
(for %O
see Android to iOS conversion)%x
and %X
hexadecimal presentation using lowercase letters (%x
) or uppercase letters (%X
)%d
will remain %d
%1$s
are converted to %1$@
and vice-versa