Qodana & IntelliJ IDEA, see how the code quality platform simplifies IDE localization!

IntelliJ IDEA is an integrated environment for java programming language development. IntelliJ is recognized as the best java development tool in the industry, especially in intelligent code assistant, automatic code prompt, refactoring, JavaEE support, various version tools (git, svn, etc.), JUnit, CVS integration, code analysis, innovative The functions such as GUI design can be said to be extraordinary.

When programmers plan large projects involving code refactoring, they should see the full picture of required changes and adjust accordingly, which is exactly what the IntelliJ IDEA team did when they needed to localize the entire UI of the IDE into Chinese, Japanese and Korean .

Using Qodana, JetBrains' code quality platform, as a single source of truth for the localization process, the IntelliJ team was able to complete the project faster than expected, a positive outcome that was driven by smart planning, accountability, and oversight.

IntelliJ IDEA v2023.1 official version download

Challenge: Isolate 13,000 hardcoded strings and efficiently monitor progress

To simplify the process of localizing the UI into the 3 languages, the IntelliJ team needed to strip all localizable entries from the source code and put them into separate properties files for translation.

Among the over 13,000 strings, some localizable strings were easily ignored and kept in the code. Hardcoded strings can be the hardest part when localizing the UI, they only appear when the software is localized, so they are hard to find. For example, after a user installs the Japanese language pack, some parts of the UI will still be in English.

As a result, the team faced a lot of tedious and repetitive work, so the localization project leader set out to find a solution that would:

  1. Automates a lot of work by continuously checking your code base for hard-coded string literals.
  2. Assign the issue to the developer responsible for fixing it.
  3. Supervises the extraction of localizable strings.

Solution: Automatic Code Inspection for Hardcoded String Literals

The localization project leader chose Qodana to simplify the code review process, resulting in a project that included the following steps:

#1. Connect Qodana to TeamCity

The IntelliJ  team connected Qodana to  TeamCity  pipelines and enabled internationalization code inspection to highlight hardcoded string literals that were not extracted into properties files as required.

#2. Configuration check configuration file

In the inspection configuration file, the team configured the scope of the inspection to ensure that the platform skips parts of legacy code, text without alphabetic characters, and strings containing only whitespace.

The team also ensured that  TeamCity  would generate a test report for each line that Qodana checked and failed if the string was not extracted.

#3. Determine the scan frequency

Once configured, Qodana is set to check codes every 4 hours. It is especially important that the scan runs independently on the server, rather than on someone's local machine, which ultimately saves the team valuable time.

Running Qodana for the first time got 10,000 failed tests in TeamCity.

#4. Assign tasks

For each test failure, the project lead assigns a developer to investigate and extract the hardcoded strings into a properties file.

#5. Monitoring results

After each Qodana check, TeamCity compares the previous results with the current report. If the developer responsible for an issue extracts the string, TeamCity will mark the test as fixed, which saves the project lead from having to manually mark the test as fixed when monitoring progress.

Additionally, teams are able to monitor progress in the Qodana Cloud dashboard. The dashboard updates information about remaining code issues in real time and compares results between different Qodana runs.

Qodana also has the ability to add selected issues to the baseline, which is also known as the technical debt section. This allows the entire team to see the same list of issues on the platform and monitor progress, the following example shows how this works.

key result

In just a few months, the number of failed tests dropped from 10,000 to zero, with an average of about 175 tests being corrected per day. The team managed to remove all hardcoded string literals from the source code, and the entire UI has been seamlessly localized with no unexpected English elements.

With Qodana, the IntelliJ team reduced manual steps in the localization process, which in turn reduced the number of human errors and made localization builds more reliable. Also, since the checks are run every 4 hours, they are able to spot issues faster and prevent minor issues from becoming major issues later on.

Finally, using Qodana as a single source of truth, team leads can easily ensure developers fix issues assigned to them.

Based on these results, the IntelliJ team will continue to use Qodana as a code quality and resource planning platform when delivering new features or improving the performance of IntelliJ IDEA.

Guess you like

Origin blog.csdn.net/AABBbaby/article/details/131080789