Skip to content
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

Externalize character chains #3

Open
mypsycho opened this issue Nov 15, 2021 · 2 comments
Open

Externalize character chains #3

mypsycho opened this issue Nov 15, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@mypsycho
Copy link
Contributor

mypsycho commented Nov 15, 2021

After a first pass to separate externalizable chains from the others by adding NON-NLS tags, about 1000 chains needs externalization.

About mwe2 generation,
there is no option to include //NON-NLS tag
but eclipse error/warning can be toggle off in "Java Build Path" cfg.

How to
To ensure no local String is used 2 tools are needed:

  • Detection: sets at project level Properties:java / compiler / errors/Warnings : non-externalized strings = error
  • Fix: Launch <ctxt>/source/Externalized String to create properties files once all technical string are escaped.
@mypsycho
Copy link
Contributor Author

mypsycho commented Nov 15, 2021

Action to perform

  • For each project:
    • Fix plugin.xml
      • Open plugin.xml and launch "Externalize Strings Wizard" (Overview/exporting)
      • Verify keys and apply
    • On each java package
      • For string concatenation, use "Quick Fix (Ctrl+1)/Convert to MessageFormat".
      • Evaluate if a String is technical (non nls) or displayed (nls)
      • Launch "Source/Externalize Strings"
    • Once all package updated, enable verification:
      • in Properties:java / compiler / errors/Warnings
      • set non-externalized strings = error

Progress

  • org.eclipse.poosl.model
    • plugin.xml
    • java classes externalized
    • Error detected
  • org.eclipse.poosl.model.edit
    • plugin.xml
    • java classes externalized
    • Error detected
  • org.eclipse.poosl.model.editor
    • plugin.xml
    • java classes externalized
    • Error detected
  • org.eclipse.poosl.pooslproject
    • plugin.xml
    • java classes externalized: 20 items
    • Error detected
  • org.eclipse.poosl.rotalumisclient
    • plugin.xml
    • java classes externalized: 337 items
    • Error detected
  • org.eclipse.poosl.sirius
    • plugin.xml
    • odesign (use % in labels)
    • java classes externalized: 205 items
    • Error detected
  • org.eclipse.poosl.transformations
    • plugin.xml
    • java classes externalized: 18 items
    • Error detected
  • org.eclipse.poosl.xtext
    • plugin.xml
    • java classes externalized: 161 items
    • Error detected
  • org.eclipse.poosl.xtext.ide
    • plugin.xml
    • java classes externalized
    • Error detected
  • org.eclipse.poosl.xtext.ui
    • plugin.xml
    • java classes externalized: 271 items
    • Error detected

@mypsycho
Copy link
Contributor Author

mypsycho commented Nov 15, 2021

Special case

org.eclipse.poosl.xtext.custom.FormattingHelper is a major problem for i18n.

It mixes technical StringBuilding (like method signature) and user messages.

Complete reengineering is required:

  • detecte use-case.
  • sort technical usage from display usage.
  • refactor each string build.

Direct usage :

  • org.eclipse.poosl.sirius.services.ClassDiagramServices
  • org.eclipse.poosl.transformations.poosl2html.Poosl2Html
  • org.eclipse.poosl.xtext.descriptions.PooslDataMethodDescription
  • org.eclipse.poosl.xtext.descriptions.PooslProcessMethodDescription
  • org.eclipse.poosl.xtext.validation.PooslJavaValidatorAcyclicRelations
  • org.eclipse.poosl.xtext.validation.PooslJavaValidatorMisc
  • org.eclipse.poosl.xtext.validation.PooslJavaValidatorMisc
  • org.eclipse.poosl.xtext.ui.contentassist.PooslProposalProviderLabel
  • org.eclipse.poosl.xtext.ui.labeling.PooslLabelProvider
  • org.eclipse.poosl.xtext.ui.outline.PooslOutlineTreeProvider
  • org.eclipse.poosl.xtext.ui.quickfix.PooslQuickfixProviderTypes

It should only be used for formatting model: expected result should be everything is non-nls

mypsycho pushed a commit that referenced this issue Nov 16, 2021
Generated sources are ignored.
mypsycho pushed a commit that referenced this issue Nov 16, 2021
@wpiers wpiers added the enhancement New feature or request label Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants