Closed benoitfragit closed 10 years ago
How about not copying modules to ~/.config/google2ubuntu/? Save args changes in google2ubuntu.xml. It should be this way because the linker arg should be localized and able to have multiple values, allowing us to have them predefined in localized default config. E.g. linker of wikipedia can be wiki or its localized forms.
Another problem with the linker (or command key) is that the text we want to input to module is not always after the linker. In some languages it would occur before the linker. E.g. for "What's the weather in [city_name]?" in Chinese we would say "[city_name] weather how?". And with the current approach, the linker of weather should be a localized " in ". So, how about if we could define a command key like "what weather in %s"?
It is true that storing the args file in the xml file will let the new user have module ready to use because translator will have to translate the linker in their language. (It is huge work to restructure : ) )
Then for the place of the linker in the sentence, I think we can imagine something with python-re (I use it for the plugin way to find the city between two words) but it will depend of the language and not all user will be able to create their own module. So maybe the easiest way maybe is simply to use a new field for module that will set if we have to proceed the text fefore or after the linker.
ps: I forgot your name in the HelpWindow I will put it for the next pre-release
I've started to work on this ticket. Now module do not need to be in a special folder, they do not need args file anymore. All modules's configuration files are stored in the google2ubuntu.xml file and for the default config in the default.xml corresponding of the language. Everything seems to work. I need some feedback before closing (I'm currently testing)
First problem I've found is that /data/entry[@name='modules']/path
in config/en_EN/default.xml are hard coded with YOUR home directory. Should they be replaced with something like <path>%CONFIG_DIR%/modules/google.sh</path>
when it is default? And then when reading it, replace %CONFIG_DIR%
(or %INSTALLED_DIR%
, etc...) to the actual location accordingly?
Everything is in the tilte