Skip to content

Releases: dougwollison/nlingual

Fixed issue with localizing URLs for sites on subdirectories.

01 Nov 17:50
57acbc6
Compare
Choose a tag to compare

Since 2.0.0 apparently, there's been a glaring issue with the home path of the site being preserved when handling the URLs. This led to weirdly truncated URLs.

Minor adjustments to meta box registration, bug fixes.

31 Oct 18:06
3000ba4
Compare
Choose a tag to compare

Tweaked how meta boxes are registered, since the previous method lead to it being registered for all post types rather than the current one.

Also fixed an issue with post_fields whitelisting in the Synchronizer.

Simplified Language & Translations meta box interface, revised post cloning process, bug fixes with upgrading, language setting, and testing.

25 Oct 19:04
366d29d
Compare
Choose a tag to compare

This update is predominantly bug fixes but includes a few new features and UI changes that warrant just doing it as a minor release instead of a patch.

New Option: Lock Post Language

This option enables you to enforce a workflow of creating content in the default language first, then creating translations from it. New posts will always be in the default language, unless of course they're being created as a translation, and their language cannot be changed while this option is enabled.

Language & Translations Meta Box Tweaks

The meta box for setting language and translations has been simplified. The headings have been removed, and the translation section will no longer show at all if the language is unset. If the Lock Post Language option is set, the language will be printed out in read-only form rather than as a dropdown.

Revised Post Cloning

Previously, the post fields portion of the clone rules were ignored, as it just blindly create a clone post with all post field preserved. On top of that, it offered cloning the post status, which defeated the purpose since under few to no circumstances would a cloned post be immediately ready to be public.

The clone system now creates a bare bone post of the same type, in draft status, with the placeholder title, and all other fields are copied over according to the clone rules designated. The filter nlingual_post_clone_rules has been functionally relocated to being called by Synchronizer::sync_posts(), as it now takes a context argument that is used to determine what filter to use and what whitelisting to use when preparing the rules for use.

Note: Due to the way the rules are stored and the install/update system not being quite as versatile as I apparently need, the option to clone post content is off by default. If you wish to keep this option enabled, you'll need to manually update your settings for each post type under New Translations on the Post Synchronizer settings page.

Bug Fixes and Improvements

  • When querying by post parent, the system checks to make sure it's post type is supported before testing if it has a language.
  • The Sticky Posts list is now filtered to get the translated versions, if applicable.
  • Ironed out issues with Localizer fetching meta values.
  • Fixed bug Languages collection that basically caused the empty dummy language to not be removed when upgrading from nLingual 1.
  • Fixed a bug that caused nLingual's hooks to re-attach if switching to a blog that had nLingual installed previously but not active.
  • Added a $require_all option to Registry::is_post_type_supported(), letting you specify if your checking if any or all post types provided are supported.

Language detection fixes, added detection and rewriting to backend, including the login page.

21 Jun 15:30
aa44582
Compare
Choose a tag to compare

This almost warrants a minor release but what the hell.

Langauge detection support on archive pages. Language detection, as well as rewriting has also been added to the backend, namely for use by the login page. Also, fixed a conflict with automatic language detection and having the default language not explicitly stated in the URL.

Also, adding a language to the system will now also download the language packs if needed and available.

Additional system support, improved translation interface, and the usual bug fixes.

06 Mar 19:11
0408cc3
Compare
Choose a tag to compare

Multisite Support

Using switch_to_blog now has nLingual check if it's running on the new current blog, and disables/re-enables as needed. The registry is also refreshed, so the translation settings used by that blog are applied to all hooks called after the switch.

Basic REST Support

The language parameter is now available in the REST API for supported post types.

Accept Code Option for Languages

When managing languages, you can now specify a comma-separated list of HTTP Accept-Language values for the language. These are now the primary way automatic language detection is handled, if present. The use case that brought this about was detecting wether to use Simplified or Traditional Chinese on a site, which depends if the visitor is based in China/Singapore, or Taiwan/Hong Kong.

Revised Interface for Creating Translations

Since the common user flow is to create a post in one language and then create a translation from it, the interface has been simplified. Now, instead of a dropdown with a "New [post type]" option to create the translation, a simple Create button will show for unassigned languages. This button will open a new window to the edit the cloned post.

In addition, when creating a new translation, the default title now uses the prefix "[Needs ? Translation]" rather than "Translate to ?". Apparently the old prefix caused some confusion with certain users. There was also an issue caused by the cache handling that caused fetching the new translations language after creation would return unexpected results.

New "Translate This" Action in Admin Bar

When viewing untranslated (but language-assigned) posts and pages, a "Translate This" action will appear in the Admin Bar for logged in users that are allowed to edit the post/page in question, with a list of languages the post/page isn't translated for. This functions exactly like the new Create button in the revised Translations meta box interface.

LocalizeThis for TinyMCE

The LocalizeThis utility can now be added to TinyMCE instances; it will properly format/store and update the editor when you switch languages.

Note: due to an issue partially caused by TinyMCE's handling of fetching raw text content, any elements styled with text-transform: uppercase will be saved as literal uppercase.

Localizer Flexibility

Using get_terms() and specifying the 'fields' option to something other than "all" or "all_with_object_ids" previous caused errors because the filter expected objects every time. It now properly ignores ids/slugs and replaces names with their localized versions. Note: this involves slightly altering the arguments when 'fields' is set to "names", but it should be non-destructive in most cases.

Additionally, you can now register fields for localizing and specify that they allow empty values, rather than always use the unlocalized version of the value if it's false-ish. Simply pass 'allow_empty' => true when registering an option, post field, or metadata field.

Translation Sync Fixes

Previously, enabling post status sync on a post type caused it to function just like the "Trash Sister Translations" option; trashing a post marked it's translations as trashed, as well as when untrashing them. This has been corrected to be more separate, synchronizing will not happen during post trashing/untrashing, unless the afore mentioned option is enabled.

Also, there was a typo causing post fields to not actually be synchronized. This was quick-patched on the WordPress repo in late February, rather than wait for this to be released.

Finally, all-meta synching has been modified so that _edit_* meta data is skipped.

Cloning Adjustments

New translations are now marked as Pending instead of Draft, and have both the local and GTM dates set so that they stay in sync from the start.

Plugin Compatibility Tweaks

The dropdown used by IndexPages is now filtered to only show pages in the default language or no language at all. Also updated handling of the notice to account for 'index-page' support if found for the relevant post type.

Other Fixes

Logged in users can now view the site in registered-but-inactive languages, for preview purposes. This will eventually be converted to a capability for more fine-tuned control.

Paginated URLs will now be handled/redirected properly. Conversely, admin URLs that specify the language will be corrected.

When auto-detecting the language of the page/index requested, the system will check for taxonomy archives first, rather than for an explicit post_type parameter in WP_Query. This fixes redirect issues when viewing taxonomy archives.

The counts displayed next to each option in the language filter dropdown are now more accurate; properly accounting for post status(es). Also added "None" option to Bulk Edit when language is not required.

When querying for posts with no language (language=0), it now properly handles the literal integer 0 rather than just the string '0'. Additionally, language-less posts will be included on the frontend if the Language is Required option is not enabled.

Added basic compatibility for WooCommerce

18 Jan 04:43
595056a
Compare
Choose a tag to compare

This update solves the issues pointed out in this thread.

The Liaison kit now includes some basic compatibility helpers for WooCommerce. In particular, it adds endpoint handling to Localizer::localize_here(), and rewrites the appropriate WC pages with their translated counterparts where needed.

Tweaked handling of inactive languages, deprecated font patching option, added TinyMCE support to LocalizeThis tool.

13 Jan 21:42
422f535
Compare
Choose a tag to compare

Inactive languages have been fixed so that they show up for filtering but not as an option for Default Language in the Translation settings page.

Also figured out how to get the LocalizeThis utility and TinyMCE to play well together. This partly involves patching the Editor.save() method, but it shouldn't cause any issues in terms of other plugins extending it the same way.

Also, since WordPress uses system fonts since 4.6, the Patch Font Stack option is hidden and won't be implementable on installs newer than 4.6.

Fixed multisite-specific database query problems.

26 Dec 03:01
480b20c
Compare
Choose a tag to compare

The way the custom tables were being added didn't allow for updating during switch_to_blog(); they are now registered in a fairly iron-clad fashion now. This will fix just about any and all issues you likely noticed trying to use it with multisite.

Also fixed added a necessary check for a post types existence in Manager::setup_synchronizer_fields()

Fixed major issue with term syncing.

24 Nov 23:48
a73b193
Compare
Choose a tag to compare

Fixed a typo (go figure) was causing the terms for the sister posts to be cleared instead of updated during sync.

Code cleanup and bug fixes for re-hooking and edge-cases.

08 Nov 16:30
0dd352c
Compare
Choose a tag to compare

Apparently there are some instances (e.g. the Yoast setup wizard) where get_current_screen() returns null. This is now accounted for, so less notices in your error log. In addition, localize_post_link checks for translation support before trying to fetch an post's language. Also, a typo causing the synchronize_posts hook to re-attach with the wrong number of accepted arguments has been fixed (oops).

Also cleaned up the code by using self:: instead of static:: since all classes are defined as final.