Class used to register built-in translation warnings.
| since | 1.0.0 |
|---|---|
| package | GlotPress |
add_all(\GP_Translation_Warnings $translation_warnings)
\GP_Translation_WarningsInstance of GP_Translation_Warnings.
warning_length(string $original, string $translation, \GP_Locale $locale) : string | true
| since | 1.0.0 |
|---|---|
| access | public |
stringThe source string.
stringThe translation.
\GP_LocaleThe locale of the translation.
stringtrueTrue 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 |
stringThe original string.
stringThe translated string.
stringtrueTrue if check is OK, otherwise warning message.warning_missing_uppercase_beginning(string $original, string $translation) : string | true
| since | 4.0.0 |
|---|---|
| access | public |
stringThe source string.
stringThe translation.
stringtrueTrue 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 |
stringThe original string.
stringThe translated string.
stringtrue
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 |
stringThe source string.
stringThe translation.
\GP_LocaleThe locale of the translation.
stringtrueTrue 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 |
stringThe source string.
stringThe translation.
\GP_LocaleThe locale of the translation.
stringtrueTrue 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 |
stringThe source string.
stringThe translation.
\GP_LocaleThe locale of the translation.
stringtrueTrue 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 |
stringThe source string.
stringThe translation.
\GP_LocaleThe locale of the translation.
stringtrueTrue 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 |
stringThe source string.
stringThe translation.
\GP_LocaleThe locale of the translation.
stringtrueTrue if check is OK, otherwise warning message.warning_unexpected_start_end_space(string $original, string $translation) : string | true
| since | 4.0.0 |
|---|---|
| access | public |
stringThe original string.
stringThe translated string.
stringtrueTrue if check is OK, otherwise warning message._placeholders_counts(string $string, string $re) : array
| since | 1.0.0 |
|---|---|
| access | private |
stringThe string to search.
stringRegular expressions to match placeholders.
arrayAn 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 |
arrayThe original array.
arraylinks_without_url_and_placeholders_are_equal(string $original_links, string $translation_links) : array | true
| since | 3.0.0 |
|---|---|
| access | private |
stringThe original links.
stringThe translated links.
arraytrueTrue 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 |