• Resolved Ulrich

    (@grapplerulrich)


    Hi David!

    Me again ??

    We are using Polylang Pro for multilingual support.

    The pro version automatically creates a translation for the media file that is uploaded. If you are using the free version you can manually create a translation for the media file.

    We have added a custom category for the media files too. You can find the code for it here: https://gist.github.com/grappler/35e54cd41f09ad39b6f9b03ae8f0ae76

    The categories are also translated. When running the bulk edit we only see the categories for the default language which is Ok.

    Instead of updating the translated categories for all of the translated posts it only updates the category in the default language in the media item in the default language.

    I am on holiday until the 11th December. I will look into the issue in further detail then.

    Thanks!

    Ulrich

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author David Lingren

    (@dglingren)

    Good to hear from you again! Thanks for describing your application and adding the link to your “media_categories” code.

    I added your code to my theme and ran some tests. On my system the Media Categories taxonomy edit screen does not show the Polylang language and translation elements. Is that the problem you are asking about?

    You have created and registered your taxonomy but you have not added translation support for it. To do that, this code to your functions.php file:

    	add_filter( 'pll_get_taxonomies', function( $taxonomies ) {
    		$taxonomies['media_category'] = 'media_category';
    		return $taxonomies;
    	} );
    

    When I added that to my system the Polylang elements appeared on the edit taxonomy screen. The Media Categories taxonomy also showed up in the Languages/Settings “Custom Post Types and Taxonomies” settings area.

    I have not done any further testing of term synchronization or replication, but if you still have problems after adding the above code, give me the details and I will investigate further. I will leave this topic unresolved until I hear back from you.

    Enjoy your holiday!

    Thread Starter Ulrich

    (@grapplerulrich)

    Hi David

    Thank you for getting back so quick.

    You have created and registered your taxonomy but you have not added translation support for it.

    We have normally used the settings to enable translations instead of the code. Though in this case we did not want to enable translations for this term. We don’t really need to enable translations as the categories are only used in the backend.

    In my testing I realized the categories were removed when editing single media items in the bulk edit.

    Let me know if you need any more information.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update. I am confused.

    In your first post you wrote:

    Instead of updating the translated categories for all of the translated posts it only updates the category in the default language in the media item in the default language.

    In your second post you wrote:

    Though in this case we did not want to enable translations for this term. We don’t really need to enable translations as the categories are only used in the backend.

    If you “don’t really need to enable translations” then “updating the translated categories for all of the translated posts” should not be a problem. MLA will only apply term synchronization if the taxonomy is marked as having translation support.

    Can you give me a specific example of what should happen and what is happening instead? Thanks for any additional information you can provide.

    Thread Starter Ulrich

    (@grapplerulrich)

    Sorry for the confusing information.

    Currently, the media is set to be translated but the category is not translated.

    Expected:
    When a category is assigned to a media item it should be added. The only time it works is when adding a category to the media item in the default language.

    Current:
    When a category is assigned to a media item all of the assigned categories are removed.

    I hope this is a bit clearer.

    MLA will only apply term synchronization if the taxonomy is marked as having translation support.

    I think this is the problem as the untranslated category should be able to added to all of the languages, not just the default language.

    Thank you for looking into it.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your additional comments. I believe I understand the problem.

    I removed the translation support from your Media Categories taxonomy and ran a few more tests. With MLA disabled, you can assign any term in the taxonomy to any item in any language. With MLA enabled, terms can be assigned to any item in the default language, but no terms can be assigned to any non-default language item. Does that match your experience?

    I was able to avoid the problem by disabling MLA’s “Term Assignment” function. Could you try that and let me know if it solves your problem?

    Navigate to the Settings/Media Library Assistant Language tab, uncheck the “Term Assignment” box and save your changes. Run a few tests.

    Of course, the setting is global in the current MLA version and will affect translated taxonomies such as Att. Categories as well as your Media Categories. I will work to fix that, but it would be helpful to know if the above settings change works for you.

    I look forward to seeing your test results. Thanks for your patience and your help.

    Thread Starter Ulrich

    (@grapplerulrich)

    Does that match your experience?

    Yes, that is the problem that I have.

    By disabling “Term Assignment” it fixes the problem. I will wait for the update.

    Thank you very much for working on this.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for confirming my theory about the cause of your problem. Thanks as well for the positive review you posted. Good reviews are a great motivator to keep working on the plugin and supporting its users.

    I have uploaded a new MLA Development Version dated 20171214 that contains the fix for untranslated taxonomies. It would be great if you can install the Development Version and do some testing of your own. To get the Development Version, follow the steps in this earlier topic:

    PHP Warning on media upload with Polylang

    I will leave this topic unresolved until the next MLA version goes out. Thanks for alerting me to this MLA defect.

    Thread Starter Ulrich

    (@grapplerulrich)

    I can confirm that the development version fixes our issue.

    Thanks! Look forward to the update.

    Plugin Author David Lingren

    (@dglingren)

    I have released MLA version 2.70, which contains the fix for your issue.

    I am marking this topic resolved, but please update it if you have any problems or further questions regarding the new version. Thanks again for your help with testing the fix.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Bulk Edit Categories across multiple languages’ is closed to new replies.