Giter VIP home page Giter VIP logo

sublanguage's People

Contributors

konradsajdak avatar maximeschoeni avatar rimas-kudelis avatar robert777robert777 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sublanguage's Issues

Problem with AJAX - wrong language

Wordpress: 5.6.2
Sublanguage: 2.7.1
Main/default language: et
Alternate language: en (locale en_US)

I have a post in other language:
https://domain.domain/en/my-post
It has correct content. OK.

I ask the same post by AJAX, passing language (tried both the slug and locale):

$.get(AJAX_URL, {
	'action': 'load_posts_by_ajax',
	'post': 'MY_POST_ID',
	'language': 'en'
});

Content is in default language. WRONG.

theme translation doesn't work with this plugin

On Frontend:
$locale = get_locale(); in functions.php returns empty value.
WP tries to load this: /wp-content/themes/gitisit/languages/.mo

If I comment your filter 'locale' in your file site.php, translation works.
add_filter('locale', array($this, 'get_locale'));
WP tries to load correct way:
/wp-content/themes/gitisit/languages/cs_CZ.mo

Otherwise everything works.

I load load_theme_textdomain() in after_setup_theme action, maybe this is problem and I should use different action.
Thank you for help

Updating the slug of a tag/category behaves erratically.

Hey! The plugin was working great for me until this bit:

When I try to translate the slug of a tag or category, most times the translation doesn't work as expected. Example: I have the tag breakfast, and translate it to another language (i.e. pt_PT) as pequenoalmoco. After clicking save, the slug is now pequenoalmoco-breakfast instead of just pequenoalmoco.

Slugs in posts work fine, but in tags and categories this problem occurs almost all the time.

BTW, it's a new Wordpress install with no other plugins except WP Markdown Editor (turned off). Speaking of WPME, I think Sublanguage causes a bug in WPME.

Thanks a bunch :)

issue with "%category%/%year%" permalink - redirected to the "category/%category%"

I am using permalink structure http://host.com/%category%/%year%/%postname%/

On the permalink setting page in the section Translate taxonomies I translated the default taxonomy word catergory.

The issue is when I am using translation of the catergory taxonomy, the permalink http://host.com/%category%/%year%/ is automatically redirected to the http://host.com/translated_taxonomy_category/%category%/.

For example:

Translation Post Category:

EN: 'news'
CS: 'novinky'
Translate taxonomies / Categories

EN: ''
CS: 'kategorie'

default: category
Open URL:

http://host.com/en/news/2015/   -> everything works fine, it shows all posts of category 'news' posted in 2015
http://aeroservis.dev/cs/novinky/2015/ -> it is redirected to the http://aeroservis.dev/cs/kategorie/novinky/

thank you.

Possibility to disable "Term Title" slug when translating categories

I have noticed that when you enable the translation of the taxonomy "Categories" there is no way to disable the actual "Term Title" slug translation aka the translation of the base slug "category".

I would like to be able to translate my category name, slug, description etc but NOT the base. Yoast SEO normally removes the category base for me. Sublanguage however puts the category base back and overrides the desired"parent-category/sub-category" structure.

Is there any way to achieve this? Thanks for the great work on this plugin!!

Woocommerce translation

Hi Maxime,

My shop is in english (& in french!!), thanks to you :) but I got three little issues here:

Products are well translated on product pages but when I add one & go into the cart, it still displays in english (someone on wordpress support said to have that same issue so I put your code snippet answer in my function.php child theme but it doesn't resolve it).

Another little issue is that when I put a product in the cart, the little mention that a product was just added into the cart (which can be clicked) is linked to the original language of the cart, not the translated one.

And last but not least, I have some automatic variations & attributes from products synced with a fulfillment company, I don't make variations myself, it's automatically done when I sync a product.
In order to translate the term "size" I checked the box variations & products in sublanguage options and.. I lose all the variations. Is there an easy way to handle that? I'm scared to have to make them by hand for each one of them!

Auto detect language not working

Hello,
I have set up your plugin on my blog. I use French and English.
The options are set as follows:
image
Everything works if I go on myblog/fr or myblog/en. If I go to myblog, it redirects me to myblog/fr.
However, on a device configured in English, I am still redirected to myblog/fr while I expected to be redirected to myblog/en. Is it normal? Thank you!
Test URL: https://adrien.poupa.fr/

Lots of autodrafts

I noticed there are a lot of autodrafts being generated, even though there are only 3 languages set up in my wp installation. The autodrafts
autodrafts-on-products
autodrafts-on-pages
only-3-languages

Is there any way I can remove those autodrafts, or make a setting somewhere so that they won't be created ?

Thank you.

Problems with custom post type URLs

I have written a WP plugin which adds a Custom Post Type named rq_issue (https://github.com/rimas-kudelis/wp-issue-manager/). This CPT uses issue as its slug. Now when I try to combine my plugin with yours, I get into trouble:

In the original language (Lithuanian in my case), the taxonomy page which lists posts of rq_issue type works fine, as in, it lists all posts with correct URLs, which look like this:

http://localhost:8000/lt/issue/issue-slug/

However, when I switch language to English, here's what happens: the taxonomy page still lists these posts, but instead of using issue as a CPT slug, it now uses rq_issue, like this:

http://localhost:8000/en/rq_issue/issue-slug/

When I click any one of these links, it results in a 404 error.

I tried using word issue as an English translation for this particular CPT (even though the sublanguage settings page states that issue is the default), but in that case, even though the links are displayed correctly, clicking on any one of them results in an infinite redirect loop where http://localhost:8000/en/issue/issue-slug/ continuously redirects to itself.

Could we fix this somehow?

translated post_name not used for slug in AJAX exchange in Gutenberg, wrong permalink

Sublanguage version 2.6

In the Gutenberg editor, when I translate the slug in the URL field under Permalink, the new value is saved in the postmeta. But it is not used to update the href behind the preview. Nor is the correct template used, so the language slug is missing in the URL as well.
Example: the text displayed is "http://192.168.1.15/en/2018/12/language-test/"
The actual link is "http://192.168.1.15/2018/12/sprachtest/"
The response is created by "\wp-includes\rest-api\endpoints\class-wp-rest-posts-controller.php". I suspect it happens in line 1480 where just the untranslated slug is fetched. Line 1608 ff probably have the same issue with the template.

Extend 'Hide this menu item in this language' to work with pages and posts

Hi, Maxime. First of all, what a wonderful plugin you've built. It's the most elegant and least bloated solution to a multi-language WordPress site I've come across.

I can see it's possible to hide menu items based on language, but is it possible to hide pages and posts as well?

For my use case, I have a custom post type of 'Product' and I want to disable some products in particular languages so that they don't show up in queries, and that trying to visit them in those locales gives a 404. Another use case could be to have a cookie policy page that is only available to users on the English or French version of the site, but not on the US or Canadian version.

Several Locale for 1 lang ?

Hi there, Is there a way to have several Locale for 1 language only ?
For example, i would like to have "fr_FR", "fr_CA" and "fr" to use French.
Any idea please ?

If i create several language do_action('sublanguage_print_language_switch') will print all French versions available instead of one "French".

Thanks

BuddyPress/BBPress errors

Hi,

Your plugin looks like it could be really perfect for my requirements, lightweight and with inheritance.

However, I am testing the latest version (2?) from the Github repo and have found it conflicts with BuddyPress and/or BBPress with the following errors produced in the Admin console:

  1. Notice: Trying to get property of non-object in C:\Websites\www.example.dev\wp-content\plugins\bbpress\includes\common\functions.php on line 1446 which appears to be related to bbp_query_post_parent__in( )

  2. Warning: in_array() expects parameter 2 to be array, null given in C:\Websites\www.example.dev\wp-content\plugins\bbpress\includes\common\functions.php on line 1446 which also appears to be related to bbp_query_post_parent__in( ) but specifically the call to in_array ( )

It would be great to resolve these issues because BuddyPress and BBPress are commonly used plugins.

Thanks

Add translated title and content in /wp-json/wp/v2/posts

Hello,

I'm trying to add translated title and content of posts in mysite.com/wp-json/wp/v2/posts but I can't find where to modify it,

Can anyone help me pointing which file in need to modify?

I tried to add 'show_in_rest' => true, in register_post_type array's in compat/sublanguage.php but it doesn't seems to work

Thanks in advance

Does not work with WordPress 5.4.1

Moving from one language to the next changes the header/footer language but the articles and pages content is always pulled from the default language.

Bizarre permalinks

Hi!

Whether I'm editing a post or a page, permalinks in original language looks fine but in the other language it appears in that form: https://mywebsite.com/fr//

I can modify it but when I save it, it returns all the time displayed like that.

It's not a big deal since link still works but it would be cool to know why..?
(reset of permalinks already done!)

Best

Translate Custom Fields

Is it possible to translate custom fields? Either ACF? Or fields appearing in the sidebar (e.g. Secondary Subtitle plugin)

Translation cause an infinite loop

Hi, somehow the wp_options of the language widget got currupted cuasing an inifinite loop and an error

The site is experiencing technical difficulties.
While debugging it i found that the options translations for sublanguage got corrupted, including in its data the translations of widget_language_widget

(1080, 'sublanguage', 'a:12:{s:4:"main";i:279;s:7:"default";i:279;s:9:"show_slug";b:1;s:10:"autodetect";b:1;s:13:"current_first";b:0;s:8:"taxonomy";a:1:{s:8:"category";a:1:{s:12:"translatable";b:0;}}s:9:"post_type";a:3:{s:4:"post";a:4:{s:12:"translatable";b:1;s:6:"fields";a:4:{i:0;s:12:"post_content";i:1;s:9:"post_name";i:2;s:12:"post_excerpt";i:3;s:10:"post_title";}s:9:"meta_keys";a:0:{}s:20:"exclude_untranslated";b:0;}s:4:"page";a:1:{s:12:"translatable";b:1;}s:13:"nav_menu_item";a:2:{s:9:"meta_keys";a:2:{i:0;s:16:"sublanguage_hide";i:1;s:14:"_menu_item_url";}s:12:"translatable";b:1;}}s:13:"frontend_ajax";b:0;s:10:"need_flush";i:0;s:7:"version";s:3:"2.6";s:10:"db_version";s:3:"2.0";s:12:"translations";a:1:{s:6:"option";a:2:{i:279;a:1:{s:25:"widget_sublanguage_widget";a:1:{i:2;a:1:{s:5:"title";s:6:"Idioma";}}}i:278;a:1:{s:11:"sublanguage";a:1:{s:12:"translations";a:1:{s:6:"option";a:1:{i:279;a:1:{s:25:"widget_sublanguage_widget";a:1:{i:2;a:1:{s:5:"title";s:8:"Language";}}}}}}}}}}', 'yes'),

(1081, 'widget_sublanguage_widget', 'a:2:{i:2;a:1:{s:5:"title";s:8:"Language";}s:12:"_multiwidget";i:1;}', 'yes'),

I solved it by deleting this record and reconfiguring the plugin again

Do you have any other reports like this?

Thanks

Autosave saves translation as revision

Wordpress 5.0.3
Sublanguage 2.6
Gutenberg Editor

If an autosave occurs while one is on a translation tab, the contents of that tab is saved a a revision - even if nothing was changed. If one then leaves the editor without saving, the editor warns that there is an autosaved newer edit. Loading this edit damages the post.

Broader browser language autodetection

Hi! First, some context.

My personal blog is nearly two decades old, and it has posts both in French and English, depending on the audience I'm targetting. As I don't have time to be writing every post twice (in every language), your plugin seems like an awesome multilingual handling plugin for me, because it doesn't force me to hide the multilingual nature of my blog behind a language "switcher", and it would allow me to finally have some elements (the UI, mainly) translated based on the visitor's browser language. Thanks for that!

Here's what I want to accomplish globally:

  • All blog posts/pages not managed by the plugin (unlike Polylang that prevents you from seeing untranslated posts in the "Latest posts" listing, for example), so that visitors can see the stream of 70% English 30% French posts without being "containerized" into a particular language. Your plugin seems to accommodate this scenario. Woohoo! :)
  • Translated UI elements: blog name, subtitle, menus, widget names and widget contents, tag and category names and descriptions (I prefer to keep the same slug; again, I don't want different URLs). It seems to work for everything except widgets (issue #42)
  • ...all of this being based on automatic detection of the visitor's browser language. i.e. English by default, and if the visitor is a francophone, show the French stuff "when available".

The problem I've found today however, is that the language autodetection doesn't seem broad enough, it doesn't seem to detect variants. In Firefox, for testing I have these languages set up:

Screenshot from 2019-07-06 11-28-48

  • With the settings like this (fr-CA, then English), my website shows up in English instead of French. Only if I bring "fr" (instead of "fr-CA") above the "en" language, does it work.
  • Another example: if I set the browser's order to "en-US", "fr-CA", "fr", "en"... I would have thought that I would get the UI showing up in English because en-US is at the top, but in practice it shows up in French because "fr" is before "en" at the end.

So in practice, the region-specific language locales (such as fr-CA, en-US) seem to be ignored and the plugin only looks at the main ("fr" and "en") languages...?

P.s.: in the published "languages" in WordPress for the sublanguages plugin, what I had published were English (slug = en, locale = en_US) and Français (slug = fr, locale = fr_CA).

Missing non-breaking spaces near French quotes (guillemets)

When displaying the French version of a website, it seems sublanguage automatically converts English typographic quotes to guillemets and adds a space before/after depending on whether it's a guillemet ouvrant or fermant... which is all fine and dandy, except that it's a regular space instead of a   so in some cases in can break as the guillemets ends up an orphan on its own line:

sublanguage guillemets sécables

Sublanguage incompatible with Custom Post Type Permalinks plugin and url hierarchies are ignored.

I have a site where I use Custom Post Type Permalinks plugin to change the directory structure of my custom post adding /%property_category%/%postname%/ to the url. Sublanguage plugin broke that functionality.

Since sublanguage rewrites the permalinks I'd need that plugin to somehow continue to work or some similar functionality within sublanguage itself in order to effect that same hierarchy.

Can code be added to facilitate that? Thanks..

Read more tag does not work on translation

Hi, I just use sublanguange and it is a great plugin. But there is a problem if I use the_content(); on my archive template, the translated content does not truncated by <!--more--> tag. Is there anybody experiencing this situation, do You have any solution for this?

Translating ACF meta values

Couldn't figure out how to translate Advabced Custom Fields values. When I switch the language through language tab in page editor, Gutenberg blocks do switch but the custom fields stay the same. I'm not able to enter values for the second language. Please help.

Post slug and link are not being translated when using the REST API

Hello!

I'm trying to use Wordpress REST API, and I ran into a problem: the post slug and link are not being translated when listing posts using /wp-json/. I can set the language by passing "language=en" to the URL, but only the post title and content are translated correctly.

This is an example of the API call I'm using:

[blog url]/wp-json/wp/v2/posts?language=en

JSON returned:

image

In the above example, the slug I expected to be: how-to-create-a-dashboard and the link: [blog url]/en/how-to-create-a-dashboard/. Both are keeping their respective default language values.

Is this a bug, or am I using the API/Sublanguage the wrong way?

Any help is appreciated.

Wordpress version: 4.9.4
Sublanguage version: 2.4

page_slug/page/2 return 404 error

Hello guys. I have a problem with custom page. Page contains some posts and pagination. When I try to go to page_slug/page/2 or higher it couse 404 error. Without plugin everything works. Please can someone help me or suggest any idea what can I do to fix it?

Thank you!

By default can you have links to a translated post only when such is available?

I have only a very few posts translated into a secondary language. But by default already the homepage of my blog shows an alternate hreflang link to the secondary language - which when accessed, adds ?language=[lang-code] to every single post.

Can this be prevented with out-of-the-box settings? Meaning, that on the translated homepage, only URLs to post having actually a translated version in the alternative language, have an added ?language=[lang-code] ?

Thanks for any hints on this,
Oliver

Trying to translate a project causes errors

Hi,
I tried sublanguage on the new projects, unsuccessfully.
At first it looks good, I can create the translation, save it, go back to the original and the translation again. URL displayed looks fine, though the creation of the URL sometimes seems to be delayed.
Only when I leave the project and try to edit it again later, the editor tells me there were a more recent autosave. It also reports an error as soon as I try to go to the translation.
The URL for the translation never works.

This is the error data I get when I click on "Fehlermeldung kopieren" (copy error message):

ea@http://photo.zakkinen.net/wp-includes/js/dist/editor.min.js?ver=9.0.6:55:161023
304/kn<@http://photo.zakkinen.net/wp-includes/js/dist/edit-post.min.js?ver=3.1.6:12:56716
ph@http://photo.zakkinen.net/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:97:88
eg@http://photo.zakkinen.net/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:125:307
fg@http://photo.zakkinen.net/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:126:168
wc@http://photo.zakkinen.net/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:138:237
fa@http://photo.zakkinen.net/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:137:115
gg@http://photo.zakkinen.net/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:135:196
Ca@http://photo.zakkinen.net/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:133:365
enqueueSetState@http://photo.zakkinen.net/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:191:324
q.prototype.setState@http://photo.zakkinen.net/wp-includes/js/dist/vendor/react.min.js?ver=16.6.3:20:291
value@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:13990
n/<@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:10354
n@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:10325
g/<.subscribe</<@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:8324
b@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:19716
y/</<@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:5320
v/</</<@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:5748
Hr/</<@http://photo.zakkinen.net/wp-includes/js/dist/vendor/lodash.min.js?ver=4.17.11:49:109
t/</<@http://photo.zakkinen.net/wp-includes/js/dist/edit-post.min.js?ver=3.1.6:12:72209
dispatch@http://photo.zakkinen.net/wp-includes/js/dist/edit-post.min.js?ver=3.1.6:12:20077
INIT/<@http://photo.zakkinen.net/wp-includes/js/dist/edit-post.min.js?ver=3.1.6:12:19319
De/<@http://photo.zakkinen.net/wp-includes/js/dist/edit-post.min.js?ver=3.1.6:12:16990
n/<@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:10354
n@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:10325
g/<.subscribe</<@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:8324
b@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:19716
y/</<@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:5320
v/</</<@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:5748
Hr/</<@http://photo.zakkinen.net/wp-includes/js/dist/vendor/lodash.min.js?ver=4.17.11:49:109
this.wp.editor</t.default/</<@http://photo.zakkinen.net/wp-includes/js/dist/editor.min.js?ver=9.0.6:12:40692
t/</<@http://photo.zakkinen.net/wp-includes/js/dist/editor.min.js?ver=9.0.6:12:28566
g/o</</<@http://photo.zakkinen.net/wp-includes/js/dist/data.min.js?ver=4.1.0:1:6127
switchLanguage@http://photo.zakkinen.net/wp-content/plugins/sublanguage/js/gutenberg.js?ver=5.0.2:110:36
updateSwitch/languageSwitchContainer</</<@http://photo.zakkinen.net/wp-content/plugins/sublanguage/js/gutenberg.js?ver=5.0.2:55:11

Doesn't tell me much yet.
Best
Henrik

fatal error after post or page update or publish

Hello,
When updating or publishing another language than the original I got a blank page returning to this url : https://xxxxxx.com/wp-admin/post.php

Debug tell me this :

Fatal error: Uncaught Error: [] operator not supported for strings in /home/xxxxxxxxxx/public_html/wp-content/plugins/sublanguage/class-admin.php:823 Stack trace: #0 /home/xxxxxxxxxx/public_html/wp-includes/class-wp-hook.php(286): Sublanguage_admin->terms_clauses(Array, Array, Array) #1 /home/xxxxxxxxxx/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(Array, Array) #2 /home/xxxxxxxxxx/public_html/wp-includes/class-wp-term-query.php(647): apply_filters('terms_clauses', Array, Array, Array) #3 /home/xxxxxxxxxx/public_html/wp-includes/class-wp-term-query.php(288): WP_Term_Query->get_terms() #4 /home/xxxxxxxxxx/public_html/wp-includes/taxonomy.php(1099): WP_Term_Query->query(Array) #5 /home/xxxxxxxxxx/public_html/wp-admin/includes/post.php(356): get_terms(Array, Array) #6 /home/xxxxxxxxxx/public_html/wp-admin/post.php(194): edit_post() #7 {main} thrown in /home/xxxxxxxxxx/public_html/wp-content/plugins/sublanguage/class-admin.php on line 823

Can you help maybe?
Thanks

PopUp for "content not saved" in Gutenberg

Hey Maxime,

this is an amazing plugin - and I was looking for something so basic for a long time!
Are you still planning on updating the plugin for newer Wordpress versions?
There seem to be some problems with Gutenberg. Even if it is working in general.
For example: When I save the new content and try to leave the page, a popup opens and tells me that I didn't save the content and if I really would like to leave.

If you are still planing on updating this plugin I would really apreceate that.
And if you need any help just let me know.

Thanks so much.

Posts in native language

Hello again Maxime,

I wish to use Sublanguage for my multilingual solution, but have some questions on whether this release or v1.5.3 is a better starting point for my requirements.

I need to allow users to post in their native language and have these stored in wp_posts as the "primary/base" post. Thus the base site language is not actually any particular language because any translations would be of the "primary/base" post language and not the site base language setting.

For example, if two users are posting, one in English (EN) and one in German (DE), whichever language creates the post should be the base for that post:

Scenario 1 - Base language EN - User1 posts an entry to wp_posts in English, and that post may (or may not) be translated into German by User2 which would be saved in wp_postmeta as a DE sublanguage.

Obviously the reverse of which is:

Scenario 2 - Base language DE - User2 posts an entry to wp_posts in German, and that post may (or may not) be translated into English by User1 which would be saved in wp_postmeta as an EN sublanguage.

Crucially, the base language in Scenario 1 is English whereas the base language in Scenario 2 is German where Sublanguage automatically adjusts the base language per post.

Is this possible?

Thanks

application/json requests get damaged (error 400)

js/ajax.js needs to check for content type and make sure it's not JSON:

    if (settings.type=='POST' **&& !settings.contentType.indexOf('json')**) {

Otherwise JSON POST requests get &language appended and fail with error 400
Attached is the fixed file.

Please add this (or better fix) in the next version.

Thank you!

ajax.js.zip

Version 2 doesn't work

Hi,
I've installed the las version of wordpress and the last version of sublanguage and doesn't work.
Menus doesn't keep the language.
When i active the permanent links with the entry name option, doesn't find the pages.
I have used it in other ocasions with older version and i didn't have any problems.

Post type slug translations into default language aren't used

Custom post type slugs can be translated into the default language, but these translations are not used.

This can be fixed by changing the topmost condition in translate_custom_post_link() from if (!$sample && $this->is_sub()) to if (!$sample). The second part of it (if (!$this->issub())) should probably wrap post name translation only.

Would it be possible for SubLanguage to be compatible with caching plugins like WP-SuperCache?

So, in case this is actually a bug, I'm filing this, but I have a gut feeling that this is going to be "this is theoretically impossible"...

On my blog, SubLanguage is set to automatically detect the user's language and try presenting the translated versions of the theme/widgets' strings (if available), keeping the URL the same.

However, I noticed now that this does not work when enabling the popular Super Cache plugin; autodetection will not swap the strings anymore. Is there a foreseeable way to make this work, or is the notion of static caching fundamentally opposed to the ability for sublanguage to function?

Allow disabling the locale code part of the URL for tags and categories when slugs are the same across languages

For my usecase, a blog where I don't necessarily translate my posts and I simply mix posts in both languages through my feed, I have disabled slugs as a "translatable post field" in wp-admin/options-general.php?page=category_language_option&taxonomy=category and in wp-admin/options-general.php?page=post_tag_language_option&taxonomy=post_tag

However, SubLanguage still insists on having those categories and tags point to /the_locale/the_tag_or_category, for example /fr/category/banana instead of /category/banana, which is a 404 because I did not set slugs for these (and I would want them to point to the same place as the English ones).

I suppose this could either be an option, or automatically disable those "fr/" URL fragments when per-language slugs are not being used...

HTML code in translate_options variables ?

Hi again,

When using the translate_options page to translate raw variable, i need to use text containing basic HTML (like HREF code). If i use the form from sublanguage, my string are converted in full HTML :

&lt;a href=&quot;/&quot;&gt;

This is confusing as original Wordpress Customizer and some plugins (ie Widget text) allow HTML code.

Thanks.

SubLanguage plugin keeps the Gutenberg editor in a permanently "dirty" state (browser warns of "unsaved changes" even if there are none

This is basically the same thing as WordPress/gutenberg#17395 and WordPress/gutenberg#24679, and I was wondering why I kept encountering the issue on my personal blog, where Firefox (tested on version 94, but it happened with any version, for years) would always warn me like this when I try to navigate away from the blog post editor, even if I just clicked the "Save draft" (or "Update post") button 2 seconds ago, or even if I enter an already published post and do not touch anything before trying to exit it:

Screenshot from 2022-02-13 11-43-54

To reproduce, with the SubLanguage plugin active:

  1. Enter editing mode for a blog post
  2. Wait for the Gutenberg editor to fully load
  3. Click the "W" wordpress logo on the top left to try to exit the editor and to go back to the posts list

Translate post but not post permalinks

Hello, I've made a permalink structure like /product_category/product_name (just by using wordpress). I needed to translate all the products, so I installed sublanguage. The problem is, it overwrites the. Is it possible to translate the post content and name but not the permalink?

Hide posts with no translation

  1. Install plugin
    1.1 Add second language (in my case RU is the main lang, I've added EN)
  2. Wait some time
  3. Go to the main EN page
  4. All the posts are displayed.

I would expect only posts with existing EN translation should be displayed, not all of them

Ability to filter out the numeric values (numbers) from Translate Options

a lot of the strings that show up in tools.php?page=translate_options are various settings that are purely numeric in value (for example "1", "-1", "1625519736", etc.) or version numbers (for example "2.0.6", "1.1.0", "6.5.4", etc. Those are booleans or UNIX timestamps or version numbers generated by various other plugins, and not only does it not make sense to translate them, but there are so many of them that it clutters the view.

I would like to have maybe a checkbox to hide them from the view so that I can more easily find the real data (ex: widgets, website UI elements, etc.) that needs to be translated.

Woocommerce > Translate Products > class-wc-query.php and price-filter.php error

First of all: Congrats for this great alternative. It's a hard and very worthwhile project. Fantastic.

That said, one problem:

If you try to check the translation of Products something (maybe an object?) in woocommerce changes and the sidebar print errors.

Using dynamic_sidebar('sidebar shop'); in the theme it will appear, for each filter:

price filter:

Trying to get property 'post_count' of non-object in /"MYHOSTHEMEPATH"/wp-content/plugins/woocommerce/includes/widgets/class-wc-widget-price-filter.php on line 80

color and other attributes:

Trying to get property 'query_vars' of non-object in /"MYHOSTHEMEPATH"/wp-content/plugins/woocommerce/includes/class-wc-query.php on line 846

Trying to get property 'query_vars' of non-object in /"MYHOSTHEMEPATH"/wp-content/plugins/woocommerce/includes/class-wc-query.php on line 858

That's it.

In any case, great work!

PS. I had to update this because I assumed it depends on the attributes, instead it is directly connected to the translation of the products

Ability to translate widgets (and/or to show different sidebars/footers)

I'm trying out your plugin as a way to translate the UI (not post contents) of my blog, which means basically the site title, menus, and widgets (whether the "about" bio blurb, or the tag/categories names—but not slugs) and it almost works flawlessly for me except that... I can't have text (or "custom HTML") widgets with multiple languages that get shown depending on the autodetected browser language.

I looked pretty much everywhere in the UI and settings for this and couldn't find that feature, so I presume it's not implemented, hence this bug report.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.