-
-
Notifications
You must be signed in to change notification settings - Fork 555
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
implement multi-lingual message and signal descriptions #240
Conversation
the test coverage should include the missing lines once the ARXML-3 patch is in. I will add it to the ARXML-4 files if you want, but this would slightly delay things for the rest of this series... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know what you think about my suggestions.
9d9052c
to
b823de7
Compare
the last revions had some serious issues, sorry for that. The new one fixes this. |
bacf8b8
to
de61daa
Compare
note that for now the default is to assume that comments which don't explicitly specify a language are in English. An alternative would be to check if the dictionary containing the comments contains exactly a single element and use that instead. The problem with this approach is that comments for different languages might get mixed up more easily: Assume a supplier based in China who documents its signals only in Chinese and a OEM based in Brazil who likes to document its stuff using Portuguese...
They where oversights made due to splitting up the big branch that adds AUTOSAR 3 support into a bunch of smaller and easy to review pull requests.
de61daa
to
3ae062d
Compare
It's not obvious to me how this should be designed. Suppose you have an ARXML-file with comments in german (no english) which you want to convert to a DBC-file. With the logic in the PR the DBC-file would not contain any comments as only One alternative design is to add a language argument to all classes and functions that need to know the language in use. By default it would probably be english (
|
I suppose that the root of this problem is that the capabiities of DBC file format and ARXML are not identical for our purposes. I agree that converting all internal code to always use a dictionary when it comes to comments would do the trick, as far as I can see. For the ARXML-to-DBC converter, I also see this the same as you: One could have specify the language which ought to be used in the DBC externally and let the |
BTW: Do you happen know why coveralls again claims that the overall coverage is down, but if you inspect the results, coverage for all individual files is equal or increased? (maybe I just misinterpret its results) |
No, I do not know why the coverage is down again =) We don't need any default policy, the language is known with |
ok, let's do it this way then. later? |
Sure, let's postpone it if it makes things easier for you. |
could you please press The Green Button? (it probably is grey ATM, though ;) |
thanks :) |
I actually meant to postpone the whole PR, but let's just redesign it later (probably before a new release). |
+1. For my current goal (i.e., proper support for Daimler-style ARXML-3 CAN description files), this is just a side concern, though. That said, I'll help with proper internationalization support where I can. |
What's special with Daimler ARXML-files? Will other companies/users still be able to use cantools? I certainly hope so. |
not much. They are basically just standard ARXML-3 files but they use a lot of features, and use a weird XML namespace. So far all of my PRs equally applied to ARXML-4... |
i.e., xmllint says they validate against the AUTOSAR 3.2 XSD which I found in the internet after changing the namespace. |
Great, you certainly add much value to the ARXML module, and if it's close enough to the standard it should be easy to support the general case as well if someone asks for it/implements it. |
This PR continues the quest for ARXML-3 support, cf https://github.com/andlaus/cantools/tree/arxml_refactor
ATTENTION: This patch includes some changes outside of the ARXML loader.
For now, the default is to assume that comments which don't explicitly specify a language are in English. An alternative would be to check if the dictionary containing the comments contains exactly a single element and use that instead. The problem with this approach is that comments for different languages might get mixed up more easily: Assume a supplier based in China who documents its signals only in Chinese and a OEM based in Brazil who likes to document its stuff using Portuguese...
Andreas Lauser andreas.lauser@mbition.io, Mercedes-Benz AG on behalf of MBition GmbH.
Imprint