Version 6.x.x Source

frappe.translate._get_messages_from_page_or_report (doctype, name, module=None)

No docs


frappe.translate.add_lang_dict (code)

Extracts messages and returns Javascript code snippet to be appened at the end of the given script

Parameters:


frappe.translate.clear_cache ()

Clear all translation assets from :meth:frappe.cache


frappe.translate.deduplicate_messages (messages)

No docs


frappe.translate.extract_messages_from_code (code, is_py=False)

Extracts translatable srings from a code file

Parameters:


frappe.translate.get_all_languages ()

Returns all language codes ar, ch etc


frappe.translate.get_all_messages_from_js_files (app_name=None)

Extracts all translatable strings from app .js files


frappe.translate.get_bench_dir ()

No docs


frappe.translate.get_dict (fortype, name=None)

Returns translation dict for a type of object.

Parameters:


frappe.translate.get_dict_from_hooks (fortype, name)

No docs


frappe.translate.get_full_dict (lang)

Load and return the entire translations dictionary for a language from :meth:frape.cache

Parameters:


frappe.translate.get_lang_dict ()

Returns all languages in dict format, full name is the key e.g. {"english":"en"}


frappe.translate.get_lang_info ()

Returns a listified version of apps/languages.txt


frappe.translate.get_lang_js (fortype, name)

Returns code snippet to be appended at the end of a JS script.

Parameters:


frappe.translate.get_language_from_code (lang)

No docs


frappe.translate.get_messages_for_app (app)

Returns all messages (list) for a specified app


frappe.translate.get_messages_from_doctype (name)

Extract all translatable messages for a doctype. Includes labels, Python code, Javascript code, html templates


frappe.translate.get_messages_from_file (path)

Returns a list of transatable strings from a code file

Parameters:


frappe.translate.get_messages_from_include_files (app_name=None)

Returns messages from js files included at time of boot like desk.min.js for desk and web


frappe.translate.get_messages_from_page (name)

Returns all translatable strings from a :class:frappe.core.doctype.Page


frappe.translate.get_messages_from_report (name)

Returns all translatable strings from a :class:frappe.core.doctype.Report


frappe.translate.get_server_messages (app)

Extracts all translatable strings (tagged with :func:frappe._) from Python modules inside an app


frappe.translate.get_untranslated (lang, untranslated_file, get_all=False)

Returns all untranslated strings for a language and writes in a file

Parameters:


frappe.translate.get_user_lang (user=None)

Set frappe.local.lang from user preferences on session beginning or resumption


frappe.translate.guess_language (lang_list=None)

Set frappe.local.lang from HTTP headers at beginning of request


frappe.translate.is_translatable (m)

No docs


frappe.translate.load_lang (lang, apps=None)

Combine all translations from .csv files in all apps


frappe.translate.make_dict_from_messages (messages, full_dict=None)

Returns translated messages as a dict in Language specified in frappe.local.lang

Parameters:


frappe.translate.pos_to_line_no (messages, code)

No docs


frappe.translate.read_csv_file (path)

Read CSV file and return as list of list

Parameters:


frappe.translate.rebuild_all_translation_files ()

Rebuild all translation files: [app]/translations/[lang].csv.


frappe.translate.rename_language (old_name, new_name)

No docs


frappe.translate.send_translations (translation_dict)

Append translated dict in frappe.local.response


frappe.translate.set_default_language (language)

Set Global default language


frappe.translate.update_translations (lang, untranslated_file, translated_file)

Update translations from a source and target file for a given language.

Parameters:


frappe.translate.write_csv_file (path, app_messages, lang_dict)

Write translation CSV file.

Parameters:


frappe.translate.write_translations_file (app, lang, full_dict=None, app_messages=None)

Write a translation file for a given language.

Parameters: