MCPcopy Create free account
hub / github.com/RocketMap/RocketMap / i8ln

Function i8ln

pogom/utils.py:300–318  ·  view source on GitHub ↗
(word)

Source from the content-addressed store, hash-verified

298
299
300def i8ln(word):
301 if config['LOCALE'] == "en":
302 return word
303 if not hasattr(i8ln, 'dictionary'):
304 file_path = os.path.join(
305 config['ROOT_PATH'],
306 config['LOCALES_DIR'],
307 '{}.min.json'.format(config['LOCALE']))
308 if os.path.isfile(file_path):
309 with open(file_path, 'r') as f:
310 i8ln.dictionary = json.loads(f.read())
311 else:
312 log.warning('Skipping translations - Unable to find locale file: %s', file_path)
313 return word
314 if word in i8ln.dictionary:
315 return i8ln.dictionary[word]
316 else:
317 log.debug('Unable to find translation for "%s" in locale %s!', word, config['LOCALE'])
318 return word
319
320
321def get_pokemon_data(pokemon_id):

Callers 3

get_pokemon_nameFunction · 0.70
get_pokemon_rarityFunction · 0.70
get_pokemon_typesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected