vial.intl module¶
This module contains usefull internationalization utilities for Vial application.
-
vial.intl.
babel_format_bytes
(size, unit='B', step_size=1024)[source]¶ Format given numeric value to human readable string describing size in B/KB/MB/GB/TB.
- Parameters
size (int) – Number to be formatted.
unit (enum) – Starting unit, possible values are [‘B’, ‘KB’, ‘MB’, ‘GB’, ‘TB’, ‘PB’, ‘EB’].
step_size (int) – Size of the step between units.
- Returns
Formatted and localized string.
- Return type
string
-
vial.intl.
babel_language_in_locale
(locale_id='en')[source]¶ Translate given locale language. By default return language in locale`s language. Optionaly return language in given locale`s language.