Changeset 13793 in josm for trunk/scripts


Ignore:
Timestamp:
2018-05-20T21:19:27+02:00 (17 months ago)
Author:
Don-vip
Message:

see #16288 - replace similar i18n strings (script update for plugins)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/I18nSimilarStrings.java

    r13761 r13793  
    33import java.util.List;
    44
     5import org.openstreetmap.josm.Main;
     6import org.openstreetmap.josm.data.Preferences;
     7import org.openstreetmap.josm.data.UndoRedoHandler;
     8import org.openstreetmap.josm.data.preferences.JosmBaseDirectories;
    59import org.openstreetmap.josm.data.validation.tests.SimilarNamedWays;
     10import org.openstreetmap.josm.gui.MainApplication;
     11import org.openstreetmap.josm.gui.MainApplicationTest;
     12import org.openstreetmap.josm.plugins.PluginHandlerTestIT;
     13import org.openstreetmap.josm.spi.preferences.Config;
    614import org.openstreetmap.josm.tools.I18n;
    715
     
    1927    public static void main(String[] args) {
    2028        I18n.init();
     29        Main.determinePlatformHook();
     30        Config.setBaseDirectoriesProvider(JosmBaseDirectories.getInstance());
     31        Preferences pref = new Preferences();
     32        Config.setPreferencesInstance(pref);
     33        pref.init(false);
     34        MainApplication.undoRedo = new UndoRedoHandler();
     35        MainApplicationTest.initContentPane();
     36        MainApplicationTest.initToolbar();
     37        MainApplicationTest.initMainMenu();
     38        PluginHandlerTestIT.loadAllPlugins();
    2139        List<String> strings = new ArrayList<>();
    2240        strings.addAll(I18n.getSingularTranslations().keySet());
    2341        strings.addAll(I18n.getPluralTranslations().keySet());
    24         System.out.println("Loaded " + strings.size() + " core strings");
     42        System.out.println("Loaded " + strings.size() + " strings");
    2543        strings.removeIf(s -> s.length() <= 5);
    26         System.out.println("Kept " + strings.size() + " core strings longer than 5 characters");
     44        System.out.println("Kept " + strings.size() + " strings longer than 5 characters");
    2745        Collections.sort(strings);
    2846        for (int i = 0; i < strings.size(); i++) {
Note: See TracChangeset for help on using the changeset viewer.