GSOC 2020 Project - Localization of Compiler Diagnostic Messages

@xedin

Hey,
I am Ajay Bharadwaj, studying at NIT Karnataka, India.

I am interested in taking up the project for "Localization of Compiler Diagnostic Messages". I have very good experience with C++ and have worked on numerous projects using C++, and I am very comfortable with it.
Would the following plan be suitable for implementing this project:

  1. Taking in the required language as a compiler flag
  2. Storing the required language's diagnostic messages in a JSON file (Or worst case, even a plain text file so that contributing new translations would be a lot easier). (The file pointer is moved according to the error diagnostic required, perhaps based on some sort of hash function). Currently, the diagnostic definitions seem to be stored in .def files if I'm not mistaken.
    Am I on the right path here?
    It would be of great help if you could guide me on how I should go about preparing for this.

Thanks in advance,
Ajay

Hi, Ajay! Thank you for the interest in the project.

  1. Taking in the required language as a compiler flag

Yes, support for a locale flag or getting it from environment sounds right.

  1. Storing the required language's diagnostic messages in a JSON file...

Yes again! One of the goals is to make it easier to work with diagnostics (without having to rebuild the compiler itself) so storing diagnostics in some human readable format is preferred e.g. YAML or JSON or something else. Diagnostics could be provided to the compiler invocation via a flag (just like locale) and would have to be loaded. I'd suggest you take a look at how DiagnosticEngine and related classes currently handle .def files because after plain text file is processed we'd like it to be efficiently stored in memory for use.

Terms of Service

Privacy Policy

Cookie Policy