Blame SOURCES/TestTranslations.java

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