hawat.intl module¶
This module contains useful internationalization utilities for Hawat application.
-
hawat.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
-
hawat.intl.
babel_language_in_locale
(locale_id='en')[source]¶ Translate given locale language. By default, return language in locale`s language. Optionally return language in given locale`s language.