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