Advanced Settings

Advanced Settings

To access the Advanced Settings, navigate to WP Dashboard Settings -> TranslatePress, and choose the tab Advanced.

The option settings found here are mostly useful for fixing issues that may occur while integrating TranslatePress into your site.

Fix missing dynamic content
Disable dynamic translation
Fix spaces between HTML attributes
Fix broken HTML
Filter Gettext wrapping from post content and title
Filter Gettext wrapping from post meta
Automatically translate slugs
Exclude Gettext Strings
Exclude from dynamic translation
Exclude selectors from translation
Do not translate certain paths
Translate numbers and numerals
Date format
Custom languages

1. Fix missing dynamic content
May help fix missing content inserted using JavaScript, if the issue manifests only on translated pages.
It shows dynamically inserted content in original language for a moment before the translation request is finished.
2. Disable dynamic translation
It disables detection of strings displayed dynamically using JavaScript.
Strings loaded via a server side AJAX call will still be translated as well as the HTML page served from the server.
3. Fix spaces between HTML attributes
If the HTML of your theme and plugins contains bad formatting, this option might help. Specifically, it fixes cases where HTML attributes don』t have spaces between them.
Below is an example of case where this option helps. Observe missing space between id attribute and class attribute.

Activating this option may help fix missing or broken content from the HTML on translated pages. In general, the issues don』t manifest in the original language.
If the issue manifests on original language too, this option probably won』t help.
4. Fix broken HTML
General attempt to fix broken or missing HTML on translated pages.
Only try this if the 「Fix spaces between html attribute」 option did not solve the issue.
If your issue is still not solved, look for bad formatting in the missing HTML and correct it in the plugins/theme.
Common bad formatting includes duplicate attribute on same tag, like the class attribute in the following example:

5. Filter Gettext wrapping from post content and title
Filters gettext wrapping such as #!trpst#trp-gettext from all updated post content and post title. Does not affect previous post content.
Database backup is recommended before switching on.
6. Filter Gettext wrapping from post meta
Filters gettext wrapping such as #!trpst#trp-gettext from all updated post meta. Does not affect previous post meta.
Database backup is recommended before switching on.
7. Automatically translate slugs
Generate automatic translations of slugs for posts, pages and Custom Post Types.
Requires SEO Pack Add-on to be installed and activated.
8. Exclude Gettext Strings

Exclude these strings from being translated as Gettext strings. Leave the domain empty to take into account any gettext string.
Can still be translated as regular strings.
Can be useful for when a Gettext string is outputted wrapped in #trpst#trp-gettext.
Also can be used when a Gettext string is used as a key in options.
After entering the string and domain click Add button to include them in the list. Click Remove to remove them from list.
9. Exclude from dynamic translation

Do not dynamically translate strings that are found in html nodes matching these selectors.
Excludes all the children of HTML nodes matching these selectors from being translated using JavaScript.
These strings will still be translated on the server side if possible.
Any type of JS selectors can be used. It』s recommended to use a selector closer to the string being inserted that needs to be excluded.
After entering the selector click Add button to include them in the list. Click Remove to remove them from list.
10. Exclude selectors from translation

Do not translate strings that are found in html nodes matching these selectors.
Excludes all the children of HTML nodes matching these selectors from being translated.
Do not use not() selector or double attribute selector [attribute1][attribute2].
After entering the selector click Add button to include them in the list. Click Remove to remove them from list.
11. Do not translate certain paths

Choose what paths can be translated. This feature has two operation modes. You can either Exclude Paths From Translation or Translate Only Certain Paths.
After choosing the operation mode, enter the paths that you want to apply this setting to. For example, to exclude https://example.com/some/path you can either use the rule /some/path/ or /some/*.
Each rule should be on it』s own line. To exclude the homepage use the {{home}} tag.
When this option is activated, the plugin will not display the language switcher on the excluded or not included pages and their translations will not be accessible.
12. Translate numbers and numerals
If checked, will enable the translation of numbers (e.g. phone numbers) found in the text. This may be useful if you want to have different contact phone numbers for each translated language of your site.
13. Date format
Provides a way to customize the display format of date and time for each translated language. Uses the same format as WordPress date and time formatting. Please note this feature does not save the translated date and time text, it just enables finer customization.
14. Custom languages

 
This feature is useful when translating your site into a language not listed under General Settings.  It allows you to input one or more so called custom languages and have them visible on the front end and in the translation options. There is no limitation on the number of custom languages that you can input. However if you are using the free version of TranslatePress the number of translation languages is limited to two.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注