Blame SOURCES/TestTranslations.java

10efc4
/* TestTranslations -- Ensure translations are available for new timezones
10efc4
   Copyright (C) 2022 Red Hat, Inc.
10efc4
10efc4
This program is free software: you can redistribute it and/or modify
10efc4
it under the terms of the GNU Affero General Public License as
10efc4
published by the Free Software Foundation, either version 3 of the
10efc4
License, or (at your option) any later version.
10efc4
10efc4
This program is distributed in the hope that it will be useful,
10efc4
but WITHOUT ANY WARRANTY; without even the implied warranty of
10efc4
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10efc4
GNU Affero General Public License for more details.
10efc4
10efc4
You should have received a copy of the GNU Affero General Public License
10efc4
along with this program.  If not, see <http://www.gnu.org/licenses/>.
10efc4
*/
10efc4
10efc4
import java.util.Arrays;
10efc4
import java.util.Locale;
10efc4
import java.util.ResourceBundle;
10efc4
10efc4
import sun.util.resources.LocaleData;
10efc4
import sun.util.locale.provider.LocaleProviderAdapter;
10efc4
10efc4
public class TestTranslations {
10efc4
    public static void main(String[] args) {
10efc4
        for (String zone : args) {
10efc4
            System.out.printf("Translations for %s\n", zone);
10efc4
            for (Locale l : Locale.getAvailableLocales()) {
10efc4
                ResourceBundle bundle = new LocaleData(LocaleProviderAdapter.Type.JRE).getTimeZoneNames(l);
10efc4
                System.out.printf("Locale: %s, language: %s, translations: %s\n", l, l.getDisplayLanguage(), Arrays.toString(bundle.getStringArray(zone)));
10efc4
            }
10efc4
        }
10efc4
    }
10efc4
}