Blame SOURCES/TestTranslations.java

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