Ticket #81 (accepted enhancement)

Opened 2 years ago

Last modified 14 months ago

"Dont Translate" Word List

Reported by: looki Owned by: ofer
Priority: minor Milestone: 2.0 - Far Future
Component: WordPress Plugin Version: 0.4.1
Keywords: Cc:

Description

So I am having problem with some words being translated, like names of places, name of people, and some other words that dont need to be translated, and, just wrap the words with the no_translate class as mentioned in the FAQ is not enough for the case I am working, that I need to deal to 500, 1000 or even 2000 posts at the same time. So, I suggest the implementation of a “dont translate list”.

I would like to see the possibility of using this feature when the word I dont want to translate is used in many places, and it is just impossible to use what was proposed and described in FAQ.

Change History

comment:1 Changed 2 years ago by ofer

  • Priority changed from critical to minor

The no_translate class is much more flexible, assuming such list exists I think the parser will become much too complicated, because it will have to break on each word, testing it against this list, and than do what? break it? Replace it somehow in the generated translation? what?

Also - names of places are translatable, just think about the name of your own country and city in different languages.

comment:2 Changed 2 years ago by looki

  • Priority changed from minor to major

Ok,

Well, about the places, I was not considering the physical places on the World, but places on the WEB, and most of these places dont have any equivalent translation to another language, or they cant be translated, because it will lost the real meaning, for example the name Google ;-). About the parser, you are looking on it thinking only to implement in the hard way, there are many other ways to implement this and without touch your parser! Take a look on my thought.

For mass posting:
-Need a background processing because it will take some time to process old posts;
-If the user enable the "dont translate list" it will use a function that will scan all old posts, where it will scan the "dont translate list" and will compare with all words in posts, and, if it find something that is pointed to dont translate, it can make use of your so called "no_translate" tag, putting the tag in all places it found a word to dont translate, later, it will continue with the normal process using your parser.

For new posting:
-Instant processing, because a post is very small and it can be fastly processed;
-If the user enable the "dont translate list" it will use a function that will do a "first pass" analysis, where it will scan the "dont translate list" and will compare with all words in posts, and, if it find something that is pointed to dont translate, it can make use of your so called "no_translate" tag, putting the tag in all places it found a word to dont translate, later, it will continue with the normal process using your parser.

The way I proposed is very simple to implement, it will keep intact your actual parser, and it will make the task of dont translate some words effortless to the owner or admin of the blog. I dont see any complication on this way. The only one thing I think you will need to do is create a "pipeline" of process if it does not exist in your plugin.

comment:3 Changed 2 years ago by looki

Well, I just forgot one thing; if you have problem to think about implementing a matching/searching function, there exist the Boyer Moore searching function, it is very fast, and there are many free implementation of it over the web. This info make the things even more easy to you implement this feature.

comment:4 Changed 14 months ago by ofer

  • Priority changed from major to minor
  • Status changed from new to accepted
  • Milestone changed from Beta wordpress plugin (0.5) to Far Future (2.0)

Hello,

The idea of implementing this on the posting action is quite good, and this can be implemented with relatively little overhead, as the parsing will happen there and will wrap said words with a no_translate class,

This bug is accepted, however being delayed to a far future release, this can be changed if anyone wants to provide a patch.

comment:5 Changed 14 months ago by looki

If I had enough knowledge of how transposh architecture is, I would try something...

Well, I will take a look on transposh codes when I can... but I cant promise much... if possible, point me any doc about where "Dont Translate" Word List could be implemented...

Thanks.

comment:6 Changed 14 months ago by ofer

Actually this has little to do with transposh, but rather more with wordpress, you need to hook to the on post event, and than process the data there using the word list, and foreach word that you find, you need to wrap it with the no_translate, transposh will do the rest

Note: See TracTickets for help on using tickets.