Android & iOS Placeholder Conversion

Applanga 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 Applanga or to maintain separate strings with the same content where only the placeholders differ.

This feature gives Applanga users the ability to convert between iOS and Android placeholders during string export. Placeholder conversion on Applanga 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 Applanga 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

  • All instances of %s and %S will be converted to %@
  • Unsupported conversion types such as %h and %tY will convert to default %@ type.
  • Boolean types %b and %B will be converted to %@
  • %h and %H are converted to %@
  • Positional strings using < are supported. Duke's Birthday: %1$tm %<te,%<tY results in Duke's Birthday: %1$@ %1$@,%1$@

iOS to Android

  • All Instances of %@ will be convert to %s
  • Unsupported conversion types by default will be converted to %s
  • Objective C integer types like %i, %u and %U are converted to %d
  • Floating point numbers %F will be converted to %f
  • Char string %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.

  • Scientific notation %e and %E
  • %c and %C Unicode Characters
  • %f floating point number
  • %g and %G computerized scientific notation
  • %a and %A Floating point numbers
  • Octal integer %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
  • Positional placeholder such as %1$s are converted to %1$@ and vice-versa