WordPress.org

Ready to get started?Download WordPress

Forums

WP Document Revisions
[resolved] Custom permalink in archive pages and translation questions (11 posts)

  1. Eduardo Larequi
    Member
    Posted 2 years ago #

    Excellent plugin, Ben. I've built a test site to check their features and translate it to spanish. Please look at http://www.elarequi.com/gestiondocumental/.

    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 http://www.elarequi.com/gestiondocumental/documentos, 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 http://www.elarequi.com/gestiondocumental/2012/04/traduccion-al-espanol-del-plugin-wp-document-revision/), 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?

    http://wordpress.org/extend/plugins/wp-document-revisions/

  2. Ben Balter
    Member
    Plugin Author

    Posted 2 years ago #

    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

  3. Ben Balter
    Member
    Plugin Author

    Posted 2 years ago #

    I've created tickets

    https://github.com/benbalter/WP-Document-Revisions/issues/6

    and

    https://github.com/benbalter/WP-Document-Revisions/issues/7

    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

  4. Ben Balter
    Member
    Plugin Author

    Posted 2 years ago #

    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?

  5. Eduardo Larequi
    Member
    Posted 2 years ago #

    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: http://www.elarequi.com/gestiondocumental/2012/04/traduccion-al-espanol-del-plugin-wp-document-revision/

    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.

  6. Eduardo Larequi
    Member
    Posted 2 years ago #

    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.

  7. Eduardo Larequi
    Member
    Posted 2 years ago #

    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: http://www.elarequi.com/gestiondocumental/documentos/

    But all file permalinks produce an 404 error. They still call the slug "document", instead of "documento". Look, for example, at http://www.elarequi.com/gestiondocumental/documents/2012/04/experimentos-con-el-plugin-wp-document-revisions.doc.

    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.

  8. Ben Balter
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  9. Eduardo Larequi
    Member
    Posted 2 years ago #

    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.

  10. Ben Balter
    Member
    Plugin Author

    Posted 2 years ago #

    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
    Thanks,
    - Ben

  11. Eduardo Larequi
    Member
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic