Part of lp.translations.browser.translationmessage View In Hierarchy
This view class could be used directly or as part of the POFileView class in which case, we would have up to 100 instances of this class using the same information at self.form.
Method | __init__ | Primes the view with information that is gathered by a parent view. |
Method | initialize | Undocumented |
Method | getOfficialTranslation | Return current translation on either side for plural form 'index'. |
Method | getCurrentTranslation | Return the current translation for the pluralform 'index'. |
Method | getOtherTranslation | Return the other-side translation for the pluralform 'index'. |
Method | getSharedTranslation | Return the shared translation for the pluralform 'index'. |
Method | getSubmittedTranslation | Return the translation submitted for the pluralform 'index'. |
Method | is_plural | Return whether there are plural forms. |
Method | message_must_be_hidden | Whether this message must be hidden from anonymous viewers. |
Method | translation_credits | Return automatically created translation if defined, or None. |
Method | singular_text | Return the singular form prepared to render in a web page. |
Method | plural_text | Return a plural form prepared to render in a web page. |
Method | text_has_tab | Whether the text to translate contain tab chars. |
Method | text_has_newline | Whether the text to translate contain newline chars. |
Method | text_has_leading_or_trailing_space | Whether the text to translate contain leading/trailing spaces. |
Method | source_comment | Return the source code comments for this ITranslationMessage. |
Method | comment | Return the translator comments for this ITranslationMessage. |
Method | file_references | Return the file references for this ITranslationMessage. |
Method | zoom_url | Return the URL where we should from the zoom icon. |
Method | zoom_alt | Undocumented |
Method | zoom_link_id | Undocumented |
Method | zoom_icon | Undocumented |
Method | max_entries | Return the max number of entries to show as suggestions. |
Method | dismissable_class | The class string for dismissable parts. |
Method | dismissable_class_other | The class string for dismissable other translations. |
Method | _set_dismiss_flags | Set dismissal flags. |
Method | _buildAllSuggestions | Builds all suggestions and puts them into suggestions_block. |
Method | _buildTranslationMessageSuggestions | Build filtered list of submissions to be shown in the view. |
Parameters | plural_indices_to_store | A dictionary that indicates whether the translation associated should be stored in our database or ignored. It's indexed by plural form. |
translations | A dictionary indexed by plural form index; BaseTranslationView constructed it based on form-submitted translations. | |
force_suggestion | Should this be a suggestion even for editors. | |
force_diverge | Should this translation be diverged. | |
error | The error related to self.context submission or None. | |
second_lang_code | The result of submiting field.alternative_value. | |
form_is_writeable | Whether the form should accept write operations | |
pofile | The POFile that's being displayed or edited. | |
can_edit | Whether the user has editing privileges on pofile . |
The flags have been initialized to False in the constructor. This method activates the right ones.
Parameters | local_suggestions | The list of local suggestions. |
other | The translation on the other side for this message or None if there is no such translation. |
Builds all suggestions and puts them into suggestions_block.
This method does the ugly nitty gritty of making sure we don't display duplicated suggestions; this is done by checking the translation strings in each submission and grabbing only one submission per string.
title
is the title for the suggestion type, suggestions
is
a list of suggestions, and index
is the plural form.
Messages are always shown to logged-in users. However, messages that are likely to contain email addresses must not be shown to anonymous visitors in order to keep them out of search engines, spam lists etc.
If there is no plural form, return None.