Support » Plugin: WP Document Revisions » [Plugin: WP Document Revisions] Custom permalink in archive pages and translation questions

  • Resolved Eduardo Larequi


    Excellent plugin, Ben. I’ve built a test site to check their features and translate it to spanish. Please look at

    I have two questions about the plugin:

    1. Is it possible to customize the URLs of custom post type archive pages “/documents”, to have something like “/documentos” (the spanish equivalent)? To get this, I’ve made a minor change in wp-document-revisions.php file, line 157. Instead of:

    ‘rewrite’ => true,

    I have added this:

    ‘rewrite’ => array( ‘slug’ => ‘documentos’),

    It works, as you can see in, but I’m not sure if this is the best way.

    2. The second group of questions has to do with the spanish translation. Although I’ve translated the plugin carefully (you can download and check it from, I can’t translate the name and description of the widget (by the way, post status in widget options are not translatable). Additionally, some plugin messages, like the one after uploading a document (“File uploaded successfully. Add a revision summary below (optional) or press Update to save your changes”), are not be translated either.

    Regarding to spanish translation, I have some doubts about the participles “checked out” and “checked in”:

    – “You currently have this file checked out”. Do you mean that the file is assigned to a user, or that it is verified?

    – “Checked in <abbr class=\”timestamp\” title=\”%1$s\” id=\”%2$s\”>%3$s</abbr> ago by %4$s”. Do you mean that the file is published, assigned…?

    I’ve looked at the Free Online Dictionary in order to check uses and meanings of the verb “check”, but I’m not sure about the best one for these two sentences.

    And finally, I have translated “Workflow States” as “Estados de publicaciĆ³n”. The literal translation in spanish is “Estados del flujo de trabajo”, but it seems to me quite strange in Spanish. I prefer “Estado de publication” which means “Publication status”. What do you think about this?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Ben Balter


    First, regarding the Spanish translation — Thank you for taking the time to contribute. There’s actually a translation in the works by another user, which you can browse on glotpress. It sounds however, if your translation has been more thoughtful / purposeful / thorough, so if you create an account, you should be able to revise by adding your version where you think appropriate. I can upgrade your account so that you can commit directly from the web interface. (the link you provided seems to 404).

    The rewrite rules (that create /documents/) are actually a custom set of rules to deal with revisions. There’s a filter, however, so you can modify the rules without editing the plugin (document_rewrite_rules).

    So you could either create a standalone plugin, or add to your functions.php something along the lines of:

    function bb_translate_document_slug( $rules ) {
    $output = array();
    foreach ( $rules as $key => $value ) {
    $output[ str_replace( 'documents', 'documentos', $key ) ] = $value;
    return $output;
    add_filter( 'document_rewrite_rules', 'bb_translate_document_slug' );

    Let me look into the missing translations (or your welcome to submit a pull request if you feel comfortable), and will be sure to update the glotpress install as well as the POT file of the development version. Last, I’ll check around and see if it makes sense to make the slug directly translatable.

    Thanks again for taking the time to contribute.

    – Ben

    Plugin Author Ben Balter


    I’ve created tickets


    I think it makes sense to make /documents/ an option in the UI… so look for that soon.

    Also, regarding “Checked out” it should be checked out as in “I checked the book out of the library” (meaning nobody else can). Meaning temporary possession. Meaning I am editing the document, but nobody else can.

    Last, my spanish is rough, but publication state make sense.

    – Ben

    Plugin Author Ben Balter


    Checked in should be the opposite of checked out, which would mean in this case, to make changes and upload a new version for others to edit/review, but could be published if the document is public. Does that make sense?

    Thanks for your quick and thorough answer, Benjamin. There are so many things to consider that I will have to think carefully abouth them. But this is what I can tell you for the moment:

    1) The current spanish translation in your GlotPress is good enough to go ahead. There are some discrepancies with mine in some points (capitalization and punctuation, not entirely respectful of the rules of Spanish orthography; have in mind that I am teacher of Spanish Language and Literature, and that’s why my standards tend to be very demanding), but I think that the effort of the current translator should be recognized with something similar to an “official” position. Nevertheless, I’ll continue with my own translation, because it suits my needs better than the other one, especially for the translation of the concept “Workflow States”.

    Your precisions on the meaning of “checked out” and “checked in” leads me to think that the current spanish translation in your GlotPress doesn’t reflect the exact meaning of these two verbs. In the context of WP Document Revision plugin, I would choose “reservado” to translate “checked out” and “liberado”, “publicado” or even “registrado” as equivalent to “checked in”. Is there any way to tell the translator to take these points into account?

    Sorry for the 404 URL. This is the correct one:

    2) Any kind of interface for the plugin, even minimal, would be much appreciated. I’m thinking not only in the spanish audience, but also in people who want to use your plugin for some peculiar situations…

    3) I will have to consider thoroughly your advice on the best way to have a custom URL for the “Document” custom post type. My PHP skills are very limited, so I must read your instructions again, and again, and again to understand them as they deserve.

    Anyway, thank you very much for your attention and patience.

    Eduardo Larequi.

    After closing the function with the curly brace, your solution to rewrite the slugs works like a charm, Benjamin. Instead of putting the function in the theme, I have added it to a plugin which also defines some taxonomies related to schools: subjects, departments, etc.

    Thank you very much.

    I am working on an article (perhaps a series) about the use of your plugin in schools. I think it can be a very good solution for some needs.

    Too early to claim victory, Ben. As I said in my previous post, once applied your function, the URL of the archive page works fine:

    But all file permalinks produce an 404 error. They still call the slug “document”, instead of “documento”. Look, for example, at

    Any idea? Is it necessary to write another function to deal with single file permalinks? Reached to this point, I’m lost in PHP code.

    Plugin Author Ben Balter


    After I posted (and began working on an option), I noticed the documents is stored in another method as well — apologies about that. I’ve roughed together the option in the development version which although buggy, seems to work (look for it under settings->media). There’s a link to the zip on that page and the development version should fix the permalink issue (you may have to hit save twice).

    As for translations, the purpose of GlotPress is to do exactly that — collaborate on developing the best translation. If there are some strings which you believe can more accurately reflect their intent, by all means, please feel free to submit them, and I will be sure both translators get credit. It’s not as if one translator “owns” the rights to translate, etc. I will also have additional strings (as a result of the option), which I will add to GlotPress soon.

    Fantastic, Ben, the UI is a great addition, you are a crack! (“eres un hacha”, as we say in spanish). The development version works fine, at least in what concerns to the customized slug; in fact, I haven’t been able to notice any bug.

    Nevertheless, there are two text chains in file /includes/admin.php which are not yet prepared to be translated:

    – “Document Upload Directory”, line 457.
    – “Document Slug”, line 458.

    As for GlotPress and the spanish translation, I’ll try to improve it during this weekend. For now, I will test (and enjoy!) your new version.

    Plugin Author Ben Balter


    Getting ready to release a new version (1.3), and could use some help kicking the tires. There are quite a few changes and several added strings if you would like to take a look.
    If you find any issues, have any ideas/feedback, etc. please feel free to submit an issue on github
    – Ben

    I’ve submitted the missing new strings for WP Document Revisions version 1.3.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: WP Document Revisions] Custom permalink in archive pages and translation questions’ is closed to new replies.