in library/src/main/java/com/whatsapp/stringpacks/StringPacks.java [137:158]
private String getTranslation(int resId, boolean isPlural, int quantity) {
final Integer location = resIdToPackIdMap.get(resId);
// This string was not moved to a StringPack. Fall back to default strings.
if (location == null) {
return fallback(resId, isPlural, quantity);
}
String translation = null;
synchronized (stringPackLock) {
if (parsedStringPack != null) {
if (isPlural) {
// TODO better fix for the int / long interfaces.
translation = parsedStringPack.getQuantityString(location, (long) quantity, pluralRules);
} else {
translation = parsedStringPack.getString(location);
}
}
}
// StringPack has not been initialized yet, fall back to default strings.
return translation != null ? translation : fallback(resId, isPlural, quantity);
}