16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/i18n_data/file_data_provider.rb', line 16
def write_cache(provider)
languages = provider.codes(
:languages,
'EN'
).keys + ['zh_CN', 'zh_TW', 'zh_HK', 'bn_IN', 'pt_BR', 'sr@latin', 'nb_NO']
languages.map do |language_code|
[:languages, :countries].each do |type|
data = provider.send(:codes, type, language_code)
write_to_file(data, cache_file_for(type, language_code))
rescue NoTranslationAvailable
warn "No translation available for #{type} #{language_code}" if $DEBUG
rescue AccessDenied
warn "Access denied for #{type} #{language_code}"
end
end
end
|