-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XWiki formats support #3187
Comments
I usually agree with that, but here it's a bit complicated: XWiki is a 15 years old wiki platform that supports translations and which can be used as a development platform. So lots of applications of XWiki are directly developed inside XWiki and needs to use the wiki pages for translations. A bit difficult to change now the way it works, especially since we try to be very careful with backward compatibility :) |
Definitely +1 for the need! That would be a big help. It would make the Weblate project a lot more extensible and cater for various extra needs. This is not about asking Weblate devs to support more formats but to allow users to do the work and provide new formats :) Please consider it, that would make weblate even more awesome and extensible. Thx for a great product. |
That sounds like an interesting feature. However, I currently don't see how such formats would be defined. I don't think that regexp (see #2978) is a good way to do this. In the end it might turn out to be easier to implement support properly in Python... |
I agree. For a first implem, I'd be really happy to "just" have an interface to implement in which I could define
|
For the XML properties stuff you can use similar approach like we do for Excel files. It does parse the XLSX file and feeds resulting CSV to the CSV format handler. See https://github.com/WeblateOrg/weblate/blob/master/weblate/formats/external.py |
Interesting, I'll check that! Actually it might even work for the other format we have: our current approach is to consider only two tags of the XML (content and title) and to create fake properties for them, so looks like I could use the same approach here. I guess I'd need to change the list of formats in https://github.com/WeblateOrg/weblate/blob/master/weblate/formats/models.py is that it? |
You can change that in the |
ok, thanks for all the info, I'll do some experiment on it |
Hi @nijel I started a while ago to implement the needed changes to support XWiki specific translations formats in Weblate, the work is not entirely finished, mainly because I had more urgent things to do and I had to adapt the changes I started to the evolutions of Weblate (for example the introduction of proppluralunit changed a bit of things :) ).
So maybe you have some other suggestions on how to extend Weblate properly? |
The additional format maintenance is pretty low, so I'd go with option 1. If there are some low-level things, the code should preferably end up in the translate-toolkit and Weblate having just thin layer on top of that. |
* Move XWiki unit formats to translate. * Integrate new formats directly in ttkit file * Move tests to test_formats * Inherit from PropertiesBaseFormat Fixes #3187
Thank you for your report, the issue you have reported has just been fixed.
|
Is your feature request related to a problem? Please describe.
As part of XWiki development we manipulate three different kind of translation formats:
If the first format is a standard one, the two others are really specific to XWiki, and we need to keep them for backward compatibility.
Describe the solution you'd like
It would be nice to have an API to define a transformation, from a monolingual source file, to its translation. To be able to define custom translation formats.
Describe alternatives you've considered
Right now we manipulate our different formats by using dedicated addons.
Basically our workflow is the following:
This solution works, but it's costly for us since we have to maintain our scripts, and it prevents us to use some nice features of Weblate such as the discovery addon.
Additional context
To give you an hint of our specific translation format, here's some link:
XWiki XML property base translation: https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-menu/xwiki-platform-menu-ui/src/main/resources/Menu/MenuTranslations.xml
XWiki XML property translation: https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-menu/xwiki-platform-menu-ui/src/main/resources/Menu/MenuTranslations.es.xml
XWiki Full page base translation: https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-sandbox/src/main/resources/Sandbox/WebHome.xml
XWiki Full page translation: https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-sandbox/src/main/resources/Sandbox/WebHome.es.xml
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: