public void setUp()

in library/src/main/java/com/whatsapp/stringpacks/StringPacks.java [70:88]


  public void setUp(@NonNull Context context) {
    // Read locale from context instead of appRes in case there is an overridden custom locale.
    final Locale locale = getLocaleFromContext(context.getResources());

    // TODO: Don't re-setup if the new locale is the same as the previous one.

    final boolean useStringPack = !useSystemResources(locale);

    appRes = resolveResources(context);

    synchronized (stringPackLock) {
      if (useStringPack) {
        parsedStringPack = loadData(context, getPackFileName(locale), locale);
      } else {
        parsedStringPack = null;
      }
      pluralRules = PluralRules.ruleForLocale(locale);
    }
  }