• Resolved hani86

    (@hani86)


    Hi,

    I am trying to get wp-multilang to work with the download monitor plugin and so far I got it to work for download titles using the following json snippet:

    {
    	"post_types": {
    		"dlm_download":{}
    	},
    	"post_fields": {
    		"post_title": {}
    	},
    	"admin_pages": [
    	]
    }

    (the above is saved as wpm-config.json in the download-monitor directory)
    However, I also want to be able to edit download categories, but it seems I need to add some more magic to my json.
    The postfield is either “name” or “tagname” depending whether you edit the category or you create one. Adding both to the post_fields does not work.

    Does anyone have an idea to get that to work?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi @hani86
    In post_fields section You need add custom fields of post type.
    By default post_title is translating for each post type.
    In admin_pages section You need add needed admin page id.
    So Your config seem like:

    
    {
    	"post_types": {
    		"dlm_download":{}
    	},
    	"admin_pages": [
               "page_id"
    	]
    }
    
    Thread Starter hani86

    (@hani86)

    Hi VaLeXaR,

    Thanks for your response. Still trying to get it to work. I am not sure what to use as page_id in the admin_pages list to trigger the multilang module. Does it need to be a form ID or some div ID or some keyword in the page URL?

    Thread Starter hani86

    (@hani86)

    Ok, found it, it seems to be edit-dlm_download_category…

    {
            "post_types": {
                    "dlm_download":{}
            },
            "post_fields": {
                    "post_title": {},
                    "name": {},
                    "tag-name": {}
            },
            "admin_pages": [
                    "edit-dlm_download_category"
            ]
    }
    

    Hi @hani86
    This is your config.

    
    {
      "post_types": {
        "dlm_download":{}
      },
      "taxonomies": {
        "dlm_download_category": {},
        "dlm_download_tag": {}
      },
      "options": {
        "dlm_no_access_error": {}
      },
      "admin_pages": [
        "dlm_download_page_download-monitor-settings"
      ]
    }
    

    Also for translating message

    • This reply was modified 7 years, 4 months ago by VaLeXaR.

    For translate templates for download link you can redefine download monitor templates in your theme and use wpm_translate_text($text) function for translate link titles.
    The author of Download Monitor do not filtering post text before display. Therefore, you will have to translate the content manually.

    • This reply was modified 7 years, 4 months ago by VaLeXaR.
    Thread Starter hani86

    (@hani86)

    Thanks a lot! That solves the categories not being translated.

    Thread Starter hani86

    (@hani86)

    Hi VaLeXaR,

    Yes, we use __() in our code to get the translated texts from the download monitor. Seems to work fine so far.

    Regards and thanks,

    Hans

    @hani86
    I added filter for translate texts that view in __().

    @hani86
    By Codex, You need use esc_attr() or esc_attr_e()for escaping html attributes.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Download monitor and wp-multilang’ is closed to new replies.