We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33175
    • 711 Posts
    Traduction of Quote from: mrcou at Jun 22, 2006, 02:54 AM

    Ce serait pas mal un WordReplace se reposant sur une table de données.
    La table aurait par exemple les champs :
    id(autoincrement) texten textfr textde et ainsi de suite.
    Et l’on pourrait préciser dans les paramètres du plugin les langues de départ et d’arrivée.
    Ce serait presque un projet à part et sortant du cadre de modx que d’alimenter cette table.
    N’y-a-t-il pas d’ailleurs de projet opensource de la sorte ?
    It would not be badly if WordReplace uses datas stored into a table of database.
    The table would have for example the fields:
    id (autoincrement) texten textfr textde and so on.
    And we could specify in the parameters of the plugin the beggining language and the arrival language.
    It would be almost a project with share and outgoing of the framework of modx which to feed this table.
    Is there no opensource project like that ?

    @mrcou : I don’t know how configure a plugin as you want. In fact, only 2 fields are needed in the database : word to change and
    word of replacement. So, I don’t understand what you want configure this plugin to specify begging and arrival.
    Could you explain to me ?
    Thanks
      Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
      • 20394
      • 134 Posts
      @Guillaume
      you may want to translate from english to french, or from french to deutch.
      In that case you should specify the two languages involved.

      (thank you for the traduction of my previous post undecided)
        • 33175
        • 711 Posts
        Ok but how could you specify the language to use ?
        If you configure the plugin to replace english word by french word, how with the same plugin you can specify to trranslate french by deutch ?
          Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
          • 20394
          • 134 Posts
          I don’t know how to do it, but perhaps we could parse the document content (or the template) and get a setting which specify the source language and the target language. We could also specify a default behavior, say english to french.
            • 33175
            • 711 Posts
            I think yiou have mistunderstood what is a plugin. A plugin is used on background when an event occured.
            You can’t affect parameter on the fly like a snippet. If you affect a parameter to a plugin and you want to modify a parameter, all the site will be affected.
            Your idea is a very good idea but it is only possible with a snippet. The problem is that a snippet can’t parse a page to modify a content.
            Currently, I have not a solution to realize your demand but I will think about this smiley

            All suggestions are welcomed.

            Thanks
              Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
              • 20394
              • 134 Posts
              You could have the documentObject when a plugin is invoked. So you could use TVs to get the source language and the target language.

              Another solution is to use a snippet in the template that replaces the placeholder [*content*].
              You could write [[content?&sourcelanguage=’en’ &targetlanguage=’fr’]].
              This snippet parses $modx->documentObject[’content’] and output the desired result.
                • 33175
                • 711 Posts
                Quote from: mrcou at Jun 28, 2006, 01:21 PM

                You could have the documentObject when a plugin is invoked. So you could use TVs to get the source language and the target language.
                I will be interesting to work onthis. It is a good idea. But, before, I need to read more the documentation about documentObject. I don’t know it smiley

                Quote from: mrcou at Jun 28, 2006, 01:21 PM

                Another solution is to use a snippet in the template that replaces the placeholder [*content*].
                You could write [[content?&sourcelanguage=’en’ &targetlanguage=’fr’]].
                This snippet parses $modx->documentObject[’content’] and output the desired result.
                Another good idea smiley The only thing that I can "reproach" is that you need mutiple template in this case : one template for one translation.

                With TV, you need one or two TV (I don’t know very well TV embarrassed) for translate every language.
                  Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
                  • 7923
                  • 4,213 Posts
                  Maybe this will give some ideas...?


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 33175
                    • 711 Posts
                    Thanks Doze smiley I will study this smiley
                      Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
                      • 16429
                      • 254 Posts
                      I use your plugin and I was wondering if it replaces html too.
                      And yes: I’ve tried tu put a paragraph with a "august" class and it replaces the class too with the Italian word "agosto".

                      Keep your eyes open! smiley
                        kudo
                        www.kudolink.com - webdesign (surprised?)

                        [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]