Theme and plugin translation for Polylang (TTfP)

Por Marcin Kazmierski
(34 avaliações)
Baixar
  • Versão:
    3.4.8
  • Última atualização:
    há 7 dias
  • Instalações ativas:
    mais de 10 mil
  • Versão do WordPress:
    5.7 ou maior
  • Testado até o WordPress:
    6.6.2
  • Versão do PHP:
    7.0 ou maior
  • Tags:

Hospedagem WordPress com plugin Theme and plugin translation for Polylang (TTfP)

Onde hospedar o plugin Theme and plugin translation for Polylang (TTfP)?

Este plugin pode ser hospedado em qualquer servidor que possua WordPress instalado. Recomendamos optar por um provedor de hospedagem seguro, com servidores especializados para WordPress, como o serviço de hospedagem WordPress da MCO2.

Hospedando o plugin Theme and plugin translation for Polylang (TTfP) em uma empresa de hospedagem de confiança

A MCO2, além de instalar o WordPress na versão mais nova para seus clientes, disponibiliza o WP SafePress, um sistema singular que salvaguarda e otimiza seu site simultaneamente.

Por que a Hospedagem WordPress funciona melhor na MCO2?

A Hospedagem WordPress funciona melhor pois a MCO2 possui servidores otimizados para WordPress. A instalação de WordPress é diferente de uma instalação trivial, pois habilita imediatamente recursos como otimização de imagens e fotos, proteção da página de login, bloqueio de atividades suspeitas diretamente no firewall, cache avançado e HTTPS ativado por padrão. São recursos que potencializam seu WordPress para a máxima segurança e o máximo desempenho.

What is “Theme and plugin translation for Polylang”?

Extension for Polylang plugin (Polylang is an extension to make multilingual WordPress websites.).
Plugin is needed to translate the WordPress themes and plugins by Polylang.

How to configure it?

Select themes and plugins to find texts for translation by Polylang.
In admin dashboard:

Languages -> TTfP Settings

How it is work?

“Theme and plugin translation for Polylang” automatically searches all files of WordPress themes and plugins. It chooses from this file only those files with extensions:

  • php
  • inc
  • twig

In addition, is implemented the integration with Timber library (read more: http://timber.upstatement.com) – which allows to translate twig’s skins in simple way.
Plugin in searched skins or plugins chooses texts from Polylang functions, such as:

  • _e(string $text, string $domain = ‘default’);
  • __(string $text, string $domain = ‘default’);
  • _x(string $text, string $context, string $domain = ‘default’);
  • pll_e(string $text);
  • pll__(string $text);
  • esc_html(string $text);
  • esc_html_e(string $text, string $domain = ‘default’);
  • esc_html__(string $text, string $domain = ‘default’);
  • _n(string $single, string $plural, int $number, string $domain = ‘default’);
  • esc_attr_e(string $text, string $domain = ‘default’);
  • esc_attr__(string $text, string $domain = ‘default’);

In your function.php, themes or plugins.

For example:

<p><?php pll_e('My text'); ?></p>

<p><?php _e('My another text', 'my_theme'); ?></p>

On the timber context declare this functions like:

$context['pll_e'] = TimberHelper::function_wrapper('pll_e');

$context['pll_'] = TimberHelper::function_wrapper('pll_');

See more on: https://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/
These functions are defined by Polylang plugin for printing translations.
Thanks “Theme and plugin translation for Polylang” you can find these strings to translate and add to Polylang register on very simple way.
And then you can translate these texts from the admin dashboard.
The scan result can be seen on the tab with translations:

Settings -> Languages -> String translation

or

Languages -> String translation

You don’t need programs like poedit – you don’t change files with extensions like: .pot, .po, .mo.
“Theme and plugin translation for Polylang” is highly efficient because the scanner is worked only on admin dashboard in tab:
In dashboard:

Settings -> Languages -> String translation

or

Languages -> String translation

Export and import string translation

In dashboard:

Languages -> TTfP Settings

Filter reference

ttfp_domains

Allows plugins and themes (in functions.php) to modify list of text domains (unique identifier for retrieving translated strings).
List of text domains is displayed on “TTfP Settings” page to select them for translation by polylang engine.

Example:

add_filter('ttfp_domains', 'custom_ttfp_domains', 10, 1);
function custom_ttfp_domains(array $domains):array
 {
     $domains[] = "my-custom-domain";
     return $domains;
 }

Filter reference

ttfp_translation_access

Returns whether the user has capability to view and edit translations provided by TTfP.

Example:

add_filter('ttfp_translation_access', 'custom_ttfp_translation_access', 10, 1);
function custom_ttfp_translation_access(bool $hasAccess):bool
 {
     return current_user_can('edit_posts');
 }

Capturas de tela

Screen show

Screen show "Polylang" strings translations with "Theme and plugin translation for Polylang".

Export/import translations as CSV file with

Export/import translations as CSV file with "Theme and plugin translation for Polylang".

Settings - Select area to be scanned in Strings translations polylang tab.

Settings - Select area to be scanned in Strings translations polylang tab.

Plugins semelhantes

Loco Translate
(422 avaliações)

Translate WordPress plugins and themes directly in your browser

Polylang
(2.665 avaliações)

Torne-se multilíngue de maneira simples e eficiente. Continue escrevendo posts e termos de taxonomia normalmente enquanto define seus idiomas de uma só vez.

Translate WordPress with GTranslate
(4.141 avaliações)

Translate WordPress with Google Translate multilanguage plugin to make your website multilingual. Complete multilingual SEO solution for WordPress.

Translate Multilingual sites – TranslatePress
(1.391 avaliações)

Translate your entire site directly from the front-end and go multilingual. Full support for WooCommerce, page builders + Google Translate integration

Translate WordPress – Google Language Translator
(561 avaliações)

Translate WordPress with Google Language Translator multilanguage plugin which allows to insert Google Translate widget anywhere on your website.

Connect Polylang for Elementor
(47 avaliações)

Connect Polylang with Elementor: translated templates, language switcher widget, language visibility conditions and more