Class used to register built-in translation warnings.
since | 1.0.0 |
---|---|
package | GlotPress |
add_all(\GP_Translation_Warnings $translation_warnings)
\GP_Translation_Warnings
Instance of GP_Translation_Warnings.
warning_length(string $original, string $translation, \GP_Locale $locale) : string | true
since | 1.0.0 |
---|---|
access | public |
string
The source string.
string
The translation.
\GP_Locale
The locale of the translation.
string
true
True if check is OK, otherwise warning message.warning_mismatching_urls(string $original, string $translation) : string | true
This allows for the scheme to change, and for some domains to change to a subdomain.
since | 3.0.0 |
---|---|
access | public |
string
The original string.
string
The translated string.
string
true
True if check is OK, otherwise warning message.warning_missing_uppercase_beginning(string $original, string $translation) : string | true
since | 4.0.0 |
---|---|
access | public |
string
The source string.
string
The translation.
string
true
True if check is OK, otherwise warning message.warning_named_placeholders(string $original, string $translation) : string | true
This only supports placeholders in the format of '###[A-Za-z_-]+###'.
todo | Check that the number of each type of placeholders are the same in the original and in the translation |
---|---|
since | 3.0.0 |
access | public |
string
The original string.
string
The translated string.
string
true
warning_placeholders(string $original, string $translation, \GP_Locale $locale) : string | true
The default regular expression: bcdefgosuxEFGX are standard printf placeholders. % is included to allow/expect %%. l is included for wp_sprintf_l()'s custom %l format. @ is included for Swift (as used for iOS mobile app) %@ string format.
since | 1.0.0 |
---|---|
access | public |
string
The source string.
string
The translation.
\GP_Locale
The locale of the translation.
string
true
True if check is OK, otherwise warning message.warning_should_begin_on_newline(string $original, string $translation, \GP_Locale $locale) : string | true
since | 1.0.0 |
---|---|
access | public |
string
The source string.
string
The translation.
\GP_Locale
The locale of the translation.
string
true
True if check is OK, otherwise warning message.warning_should_end_on_newline(string $original, string $translation, \GP_Locale $locale) : string | true
since | 1.0.0 |
---|---|
access | public |
string
The source string.
string
The translation.
\GP_Locale
The locale of the translation.
string
true
True if check is OK, otherwise warning message.warning_should_not_begin_on_newline(string $original, string $translation, \GP_Locale $locale) : string | true
since | 1.0.0 |
---|---|
access | public |
string
The source string.
string
The translation.
\GP_Locale
The locale of the translation.
string
true
True if check is OK, otherwise warning message.warning_should_not_end_on_newline(string $original, string $translation, \GP_Locale $locale) : string | true
since | 1.0.0 |
---|---|
access | public |
string
The source string.
string
The translation.
\GP_Locale
The locale of the translation.
string
true
True if check is OK, otherwise warning message.warning_unexpected_start_end_space(string $original, string $translation) : string | true
since | 4.0.0 |
---|---|
access | public |
string
The original string.
string
The translated string.
string
true
True if check is OK, otherwise warning message._placeholders_counts(string $string, string $re) : array
since | 1.0.0 |
---|---|
access | private |
string
The string to search.
string
Regular expressions to match placeholders.
array
An array with counts per placeholder.check_valid_html(array $original_parts, array $translation_parts) : string | true
get_values_from_href_src(array $content) : array
since | 3.0.0 |
---|---|
access | private |
array
The original array.
array
links_without_url_and_placeholders_are_equal(string $original_links, string $translation_links) : array | true
since | 3.0.0 |
---|---|
access | private |
string
The original links.
string
The translated links.
array
true
True if check is OK, otherwise warning message.$allowed_domain_changes : array
array('wordpress.org' => '[^.]+\.wordpress\.org', 'wordpress.com' => '[^.]+\.wordpress\.com', 'en.gravatar.com' => '[^.]+\.gravatar\.com', 'en.wikipedia.org' => '[^.]+\.wikipedia\.org')
since | 3.0.0 |
---|---|
access | public |
$languages_without_italics : array
array('ja', 'ko', 'zh', 'zh-hk', 'zh-cn', 'zh-sg', 'zh-tw')
since | 3.0.0 |
---|---|
access | public |
$length_exclude_languages : array
array('art-xemoji', 'ja', 'ko', 'zh', 'zh-hk', 'zh-cn', 'zh-sg', 'zh-tw')
since | 1.0.0 |
---|---|
access | public |
$length_lower_bound : float
0.2
since | 1.0.0 |
---|---|
access | public |
$length_upper_bound : float
5.0
since | 1.0.0 |
---|---|
access | public |