localizedResource property

BaseBaseResource get localizedResource

获取当前语言下对应的资源,若为 null 则返回 BrnResourceZh

Implementation

BaseBaseResource get localizedResource {
  // 支持动态资源文件
  BaseBaseResource? resource =
      _BrnIntlHelper.findIntlResourceOfType<BaseBaseResource>(locale);
  if (resource != null) return resource;
  // 常规的多语言资源加载
  return _defaultResourceMap[locale.languageCode] ??
      _defaultResourceMap['zh']!;
}