diff --git a/.tx/config b/.tx/config index 44aa46c61..e6b745e9a 100644 --- a/.tx/config +++ b/.tx/config @@ -7,3 +7,9 @@ source_file = i18n/inasafe_en.ts source_lang = en type = QT +[inasafe-code.inasafe-realtime] +file_filter = realtime/i18n/inasafe_realtime_.ts +source_file = realtime/i18n/inasafe_realtime_en.ts +source_lang = en +type = QT + diff --git a/Makefile b/Makefile index 7be1a1e60..c5d4e3655 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,11 @@ update-translation-strings: @echo "Checking current translation." @scripts/update-strings.sh $(LOCALES) +update-realtime-translation-strings: + #update application strings + @echo "Checking current translation." + @realtime/scripts/update-strings.sh $(LOCALES) + #Qt .qm file updates - run to create binary representation of translated strings for translation in safe_qgis compile-translation-strings: @#Compile qt messages binary @@ -41,6 +46,13 @@ compile-translation-strings: @lrelease-qt4 inasafe.pro @rm inasafe.pro +#Qt .qm file updates - run to create binary representation of translated strings for translation in safe_qgis +compile-realtime-translation-strings: + @#Compile qt messages binary + @realtime/scripts/create_pro_file.sh + @lrelease-qt4 inasafe.pro + @rm inasafe.pro + test-translations: @echo @echo "----------------------------------------------------------------" @@ -349,6 +361,25 @@ docker-test: testdata clean --verbose \ --cover-package=safe safe +docker-update-translation-strings: + @echo "Update translation using docker" + @docker run -t -i -v $(PWD):/home kartoza/qt-translation make update-translation-strings + +docker-update-realtime-translation-strings: + @echo "Update translation using docker" + @docker run -t -i -v $(PWD):/home kartoza/qt-translation make update-realtime-translation-strings + +docker-compile-translation-strings: + @echo "Update translation using docker" + @docker run -t -i -v $(PWD):/home kartoza/qt-translation make compile-translation-strings + +docker-compile-realtime-translation-strings: + @echo "Update translation using docker" + @docker run -t -i -v $(PWD):/home kartoza/qt-translation make compile-realtime-translation-strings + +docker-test-translation: + @echo "Update translation using docker" + @docker run -t -i -v $(PWD):/home kartoza/qt-translation make test-translations ########################################################## # diff --git a/realtime/ash/ash_event.py b/realtime/ash/ash_event.py index 9a1652174..6ae67c54d 100644 --- a/realtime/ash/ash_event.py +++ b/realtime/ash/ash_event.py @@ -8,7 +8,8 @@ import pytz import shutil -from PyQt4.QtCore import QObject, QFileInfo, QUrl + +from PyQt4.QtCore import QCoreApplication, QObject, QFileInfo, QUrl, QTranslator from PyQt4.QtXml import QDomDocument from qgis.core import ( QgsProject, @@ -22,7 +23,10 @@ from headless.tasks.utilities import download_file from realtime.exceptions import MapComposerError from realtime.utilities import realtime_logger_name -from safe.common.exceptions import ZeroImpactException, KeywordNotFoundError +from safe.common.exceptions import ( + ZeroImpactException, + KeywordNotFoundError, + TranslationLoadError) from safe.common.utilities import format_int from safe.impact_functions.core import population_rounding from safe.impact_functions.impact_function_manager import \ @@ -107,6 +111,8 @@ def __init__( if not self.locale: self.locale = 'en' + self.setup_i18n() + if not working_dir: raise Exception("Working directory can't be empty") self.working_dir = working_dir @@ -135,7 +141,6 @@ def __init__( self.project_path = self.working_dir_path('project.qgs') self.impact_exists = None self.impact_zip_path = self.working_dir_path('impact.zip') - self.locale = 'en' self.population_path = population_path self.cities_path = cities_path @@ -847,3 +852,40 @@ def generate_report(self): map_renderer.setDestinationCrs(default_crs) map_renderer.setProjectionsEnabled(False) LOGGER.info('Report generation completed.') + + def setup_i18n(self): + """Setup internationalisation for the reports. + + Args: + None + Returns: + None. + Raises: + TranslationLoadException + """ + locale_name = self.locale + + root = os.path.abspath( + os.path.join( + os.path.dirname(__file__), + os.pardir, + os.pardir)) + translation_path = os.path.join( + root, + 'realtime', + 'i18n', + 'inasafe_realtime_' + str(locale_name) + '.qm') + if os.path.exists(translation_path): + self.translator = QTranslator() + result = self.translator.load(translation_path) + LOGGER.debug('Switched locale to %s' % translation_path) + if not result: + message = 'Failed to load translation for %s' % locale_name + LOGGER.exception(message) + raise TranslationLoadError(message) + # noinspection PyTypeChecker, PyCallByClass, PyArgumentList + QCoreApplication.installTranslator(self.translator) + else: + if locale_name != 'en': + message = 'No translation exists for %s' % locale_name + LOGGER.exception(message) diff --git a/realtime/earthquake/shake_event.py b/realtime/earthquake/shake_event.py index 7269a8971..0bb647f71 100644 --- a/realtime/earthquake/shake_event.py +++ b/realtime/earthquake/shake_event.py @@ -1962,8 +1962,9 @@ def setup_i18n(self): os.pardir)) translation_path = os.path.join( root, + 'realtime', 'i18n', - 'inasafe_' + str(locale_name) + '.qm') + 'inasafe_realtime_' + str(locale_name) + '.qm') if os.path.exists(translation_path): self.translator = QTranslator() result = self.translator.load(translation_path) diff --git a/realtime/flood/flood_event.py b/realtime/flood/flood_event.py index cefaf6f61..c7df09cab 100644 --- a/realtime/flood/flood_event.py +++ b/realtime/flood/flood_event.py @@ -893,8 +893,9 @@ def setup_i18n(self): os.pardir)) translation_path = os.path.join( root, + 'realtime', 'i18n', - 'inasafe_' + str(locale_name) + '.qm') + 'inasafe_realtime_' + str(locale_name) + '.qm') if os.path.exists(translation_path): self.translator = QTranslator() result = self.translator.load(translation_path) diff --git a/realtime/i18n/inasafe_realtime_af.qm b/realtime/i18n/inasafe_realtime_af.qm new file mode 100644 index 000000000..9dad8dffc Binary files /dev/null and b/realtime/i18n/inasafe_realtime_af.qm differ diff --git a/realtime/i18n/inasafe_realtime_af.ts b/realtime/i18n/inasafe_realtime_af.ts new file mode 100644 index 000000000..e706148ac --- /dev/null +++ b/realtime/i18n/inasafe_realtime_af.ts @@ -0,0 +1,382 @@ + + + AshEvent + + + Volcanic Ash Impact + + + + + Volcano: %s, %s + + + + + Province: %s + + + + + Alert Level: %s + + + + + Position: %s, %s; Eruption Column Height (a.s.l) - %d m + + + + + Elapsed time since event: %s hour(s) and %s minute(s) + + + + + Potential impact at each fallout level + + + + + Nearby places + + + + + Land Cover Impact + + + + + The impact estimation is automatically generated and only takes into account the population, cities and land cover affected by different levels of volcanic ash fallout at surface level. The estimate is based on volcanic ash fallout data from Badan Geologi, population count data derived by DMInnovation from worldpop.org.uk, place information and land cover classification data provided by Indonesian Geospatial Portal at http://portal.ina-sdi.or.id and software developed by BNPB. Limitation in the estimates of surface fallout, population and place names datasets may result in a significant misrepresentation of the on-the-surface situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified by ground truthing and other reliable information sources. + + + + + This report was created using InaSAFE version %s. Visit http://inasafe.org for more information. + + + + + Supported by DMInnovation, Geoscience Australia and the World Bank-GFDRR + + + + + People Affected + + + + + FloodEvent + + + THE GOVERNMENT OF DKI JAKARTA PROVINCE +REGIONAL DISASTER MANAGEMENT AGENCY + + + + + + FLOOD IMPACT REPORT FOR POPULATION + + + + + Based on flood %s + + + + + Legend + + + + + InaSAFE Analysis Result + + + + + Data Source + + + + + Contact + + + + + Supported by + + + + + Disclaimer + + + + + Data Sources: +1. Hazard Data + Flood: BPBD DKI Jakarta / PetaJakarta.org +2. Exposure Data + Population: Population Agency DKI Jakarta Prov. + + + + + + This impact estimate is automatically generated and only takes into account the population affected by flood hazard in Jakarta. The estimate is based on flood hazard data from BPBD DKI Jakarta and population exposure data from the Population Agency, DKI Jakarta Province. Limitations in the estimates of flood hazard and population may result in significant misrepresentation of the on-the-surface situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified with other reliable information sources. + + + + + Pusat Pengendalian Operasi (Pusdalops) +BPBD Provinsi DKI Jakarta +Gedung Dinas Teknis Lt. 5 +Jl. Abdul Muis No. 66, Telp. 121 + + + + + + %s + + + + + Total affected population (people) + + + + + Estimates of IDP (people) + + + + + Relief items to be provided %s : + + + + + People Affected + + + + + Flood Depth (cm) + + + + + ShakeEvent + + + Not felt + + + + + Weak + + + + + Light + + + + + Moderate + + + + + Strong + + + + + Very strong + + + + + Severe + + + + + Violent + + + + + Extreme + + + + + None + + + + + Very light + + + + + Mod/Heavy + + + + + Heavy + + + + + Very heavy + + + + + Name + + + + + Population (x 1000) + + + + + Intensity + + + + + People Exposed (x 1000) + + + + + Perceived Shaking + + + + + Estimated Earthquake Impact + + + + + Estimated number of people exposed by each MMI level + + + + + Estimated fatalities + + + + + Nearby Places + + + + + Population count per grid cell + + + + + This impact estimation is automatically generated and only takes into account the population and cities affected by different levels of ground shaking. The estimate is based on ground shaking data from BMKG, population count data derived by DMInnovation from worldpop.org.uk and BPS Census Data 2010, place information data provided by Indonesian Geospatial Portal at http://tanahair.indonesia.go.id and software developed by BNPB. Limitations in the estimates of ground shaking, population and place names datasets may result in significant misrepresentation of the on-the-ground situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified by ground truthing and other reliable information sources. The fatality calculation assumes that no fatalities occur for shake levels below MMI 4. Fatality counts of less than 50 are rounded down. + + + + + This report was created using InaSAFE version %s. Visit http://inasafe.org for more information. + + + + + Supported by the Australian Government, Geoscience Australia and the World Bank-GFDRR. + + + + + km + + + + + of + + + + + bearing + + + + + n/a + + + + + Elapsed time since event + + + + + Latitude + + + + + Longitude + + + + + Depth + + + + + Located + + + + + minute(s) + + + + + hour(s) + + + + + days + + + + + weeks + + + + + Version: %s + + + + \ No newline at end of file diff --git a/realtime/i18n/inasafe_realtime_en.ts b/realtime/i18n/inasafe_realtime_en.ts new file mode 100644 index 000000000..02f1ff7a7 --- /dev/null +++ b/realtime/i18n/inasafe_realtime_en.ts @@ -0,0 +1,383 @@ + + + + AshEvent + + + Volcanic Ash Impact + + + + + Volcano: %s, %s + + + + + Province: %s + + + + + Alert Level: %s + + + + + Position: %s, %s; Eruption Column Height (a.s.l) - %d m + + + + + Elapsed time since event: %s hour(s) and %s minute(s) + + + + + Potential impact at each fallout level + + + + + Nearby places + + + + + Land Cover Impact + + + + + The impact estimation is automatically generated and only takes into account the population, cities and land cover affected by different levels of volcanic ash fallout at surface level. The estimate is based on volcanic ash fallout data from Badan Geologi, population count data derived by DMInnovation from worldpop.org.uk, place information and land cover classification data provided by Indonesian Geospatial Portal at http://portal.ina-sdi.or.id and software developed by BNPB. Limitation in the estimates of surface fallout, population and place names datasets may result in a significant misrepresentation of the on-the-surface situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified by ground truthing and other reliable information sources. + + + + + This report was created using InaSAFE version %s. Visit http://inasafe.org for more information. + + + + + Supported by DMInnovation, Geoscience Australia and the World Bank-GFDRR + + + + + People Affected + + + + + FloodEvent + + + THE GOVERNMENT OF DKI JAKARTA PROVINCE +REGIONAL DISASTER MANAGEMENT AGENCY + + + + + + FLOOD IMPACT REPORT FOR POPULATION + + + + + Based on flood %s + + + + + Legend + + + + + InaSAFE Analysis Result + + + + + Data Source + + + + + Contact + + + + + Supported by + + + + + Disclaimer + + + + + Data Sources: +1. Hazard Data + Flood: BPBD DKI Jakarta / PetaJakarta.org +2. Exposure Data + Population: Population Agency DKI Jakarta Prov. + + + + + + This impact estimate is automatically generated and only takes into account the population affected by flood hazard in Jakarta. The estimate is based on flood hazard data from BPBD DKI Jakarta and population exposure data from the Population Agency, DKI Jakarta Province. Limitations in the estimates of flood hazard and population may result in significant misrepresentation of the on-the-surface situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified with other reliable information sources. + + + + + Pusat Pengendalian Operasi (Pusdalops) +BPBD Provinsi DKI Jakarta +Gedung Dinas Teknis Lt. 5 +Jl. Abdul Muis No. 66, Telp. 121 + + + + + + %s + + + + + Total affected population (people) + + + + + Estimates of IDP (people) + + + + + Relief items to be provided %s : + + + + + People Affected + + + + + Flood Depth (cm) + + + + + ShakeEvent + + + Not felt + + + + + Weak + + + + + Light + + + + + Moderate + + + + + Strong + + + + + Very strong + + + + + Severe + + + + + Violent + + + + + Extreme + + + + + None + + + + + Very light + + + + + Mod/Heavy + + + + + Heavy + + + + + Very heavy + + + + + Name + + + + + Population (x 1000) + + + + + Intensity + + + + + People Exposed (x 1000) + + + + + Perceived Shaking + + + + + Estimated Earthquake Impact + + + + + Estimated number of people exposed by each MMI level + + + + + Estimated fatalities + + + + + Nearby Places + + + + + Population count per grid cell + + + + + This impact estimation is automatically generated and only takes into account the population and cities affected by different levels of ground shaking. The estimate is based on ground shaking data from BMKG, population count data derived by DMInnovation from worldpop.org.uk and BPS Census Data 2010, place information data provided by Indonesian Geospatial Portal at http://tanahair.indonesia.go.id and software developed by BNPB. Limitations in the estimates of ground shaking, population and place names datasets may result in significant misrepresentation of the on-the-ground situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified by ground truthing and other reliable information sources. The fatality calculation assumes that no fatalities occur for shake levels below MMI 4. Fatality counts of less than 50 are rounded down. + + + + + This report was created using InaSAFE version %s. Visit http://inasafe.org for more information. + + + + + Supported by the Australian Government, Geoscience Australia and the World Bank-GFDRR. + + + + + km + + + + + of + + + + + bearing + + + + + n/a + + + + + Elapsed time since event + + + + + Latitude + + + + + Longitude + + + + + Depth + + + + + Located + + + + + minute(s) + + + + + hour(s) + + + + + days + + + + + weeks + + + + + Version: %s + + + + diff --git a/realtime/i18n/inasafe_realtime_es_ES.qm b/realtime/i18n/inasafe_realtime_es_ES.qm new file mode 100644 index 000000000..ded5339bf Binary files /dev/null and b/realtime/i18n/inasafe_realtime_es_ES.qm differ diff --git a/realtime/i18n/inasafe_realtime_es_ES.ts b/realtime/i18n/inasafe_realtime_es_ES.ts new file mode 100644 index 000000000..be941bca9 --- /dev/null +++ b/realtime/i18n/inasafe_realtime_es_ES.ts @@ -0,0 +1,383 @@ + + + + AshEvent + + + Volcanic Ash Impact + + + + + Volcano: %s, %s + + + + + Province: %s + + + + + Alert Level: %s + + + + + Position: %s, %s; Eruption Column Height (a.s.l) - %d m + + + + + Elapsed time since event: %s hour(s) and %s minute(s) + + + + + Potential impact at each fallout level + + + + + Nearby places + + + + + Land Cover Impact + + + + + The impact estimation is automatically generated and only takes into account the population, cities and land cover affected by different levels of volcanic ash fallout at surface level. The estimate is based on volcanic ash fallout data from Badan Geologi, population count data derived by DMInnovation from worldpop.org.uk, place information and land cover classification data provided by Indonesian Geospatial Portal at http://portal.ina-sdi.or.id and software developed by BNPB. Limitation in the estimates of surface fallout, population and place names datasets may result in a significant misrepresentation of the on-the-surface situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified by ground truthing and other reliable information sources. + + + + + This report was created using InaSAFE version %s. Visit http://inasafe.org for more information. + + + + + Supported by DMInnovation, Geoscience Australia and the World Bank-GFDRR + + + + + People Affected + + + + + FloodEvent + + + THE GOVERNMENT OF DKI JAKARTA PROVINCE +REGIONAL DISASTER MANAGEMENT AGENCY + + + + + + FLOOD IMPACT REPORT FOR POPULATION + + + + + Based on flood %s + + + + + Legend + Leyenda + + + + InaSAFE Analysis Result + + + + + Data Source + + + + + Contact + + + + + Supported by + + + + + Disclaimer + Descargo de responsabilidad + + + + Data Sources: +1. Hazard Data + Flood: BPBD DKI Jakarta / PetaJakarta.org +2. Exposure Data + Population: Population Agency DKI Jakarta Prov. + + + + + + This impact estimate is automatically generated and only takes into account the population affected by flood hazard in Jakarta. The estimate is based on flood hazard data from BPBD DKI Jakarta and population exposure data from the Population Agency, DKI Jakarta Province. Limitations in the estimates of flood hazard and population may result in significant misrepresentation of the on-the-surface situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified with other reliable information sources. + + + + + Pusat Pengendalian Operasi (Pusdalops) +BPBD Provinsi DKI Jakarta +Gedung Dinas Teknis Lt. 5 +Jl. Abdul Muis No. 66, Telp. 121 + + + + + + %s + + + + + Total affected population (people) + + + + + Estimates of IDP (people) + + + + + Relief items to be provided %s : + + + + + People Affected + + + + + Flood Depth (cm) + + + + + ShakeEvent + + + Not felt + No se siente + + + + Weak + Débil + + + + Light + Suave + + + + Moderate + Moderado + + + + Strong + Fuerte + + + + Very strong + Muy fuerte + + + + Severe + Severo + + + + Violent + Violento + + + + Extreme + Extremo + + + + None + Ninguno + + + + Very light + Muy suave + + + + Mod/Heavy + Moderado/Pesado + + + + Heavy + Pesado + + + + Very heavy + Muy pesado + + + + Name + Nombre + + + + Population (x 1000) + Población (x 1000) + + + + Intensity + Intensidad + + + + People Exposed (x 1000) + + + + + Perceived Shaking + Sacudida percibida + + + + Estimated Earthquake Impact + Impacto estimado del terremoto + + + + Estimated number of people exposed by each MMI level + + + + + Estimated fatalities + Muertes estimadas + + + + Nearby Places + Lugares cercanos + + + + Population count per grid cell + + + + + This impact estimation is automatically generated and only takes into account the population and cities affected by different levels of ground shaking. The estimate is based on ground shaking data from BMKG, population count data derived by DMInnovation from worldpop.org.uk and BPS Census Data 2010, place information data provided by Indonesian Geospatial Portal at http://tanahair.indonesia.go.id and software developed by BNPB. Limitations in the estimates of ground shaking, population and place names datasets may result in significant misrepresentation of the on-the-ground situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified by ground truthing and other reliable information sources. The fatality calculation assumes that no fatalities occur for shake levels below MMI 4. Fatality counts of less than 50 are rounded down. + + + + + This report was created using InaSAFE version %s. Visit http://inasafe.org for more information. + + + + + Supported by the Australian Government, Geoscience Australia and the World Bank-GFDRR. + + + + + km + km + + + + of + de + + + + bearing + + + + + n/a + n/a + + + + Elapsed time since event + Tiempo transcurrido del suceso + + + + Latitude + Latitud + + + + Longitude + Longitud + + + + Depth + Profundidad + + + + Located + Ubicado + + + + minute(s) + minuto(s) + + + + hour(s) + hora(s) + + + + days + días + + + + weeks + semanas + + + + Version: %s + Versión: %s + + + diff --git a/realtime/i18n/inasafe_realtime_fr.qm b/realtime/i18n/inasafe_realtime_fr.qm new file mode 100644 index 000000000..b3f3f6fe1 Binary files /dev/null and b/realtime/i18n/inasafe_realtime_fr.qm differ diff --git a/realtime/i18n/inasafe_realtime_fr.ts b/realtime/i18n/inasafe_realtime_fr.ts new file mode 100644 index 000000000..cfbbcf839 --- /dev/null +++ b/realtime/i18n/inasafe_realtime_fr.ts @@ -0,0 +1,390 @@ + + + + AshEvent + + + Volcanic Ash Impact + Impact des cendres volcaniques + + + + Volcano: %s, %s + + + + + Province: %s + Province: %s + + + + Alert Level: %s + + + + + Position: %s, %s; Eruption Column Height (a.s.l) - %d m + + + + + Elapsed time since event: %s hour(s) and %s minute(s) + + + + + Potential impact at each fallout level + Impact potentiel à chaque niveau de retombée + + + + Nearby places + Lieux proches + + + + Land Cover Impact + Impact sur l'occupation du sol + + + + The impact estimation is automatically generated and only takes into account the population, cities and land cover affected by different levels of volcanic ash fallout at surface level. The estimate is based on volcanic ash fallout data from Badan Geologi, population count data derived by DMInnovation from worldpop.org.uk, place information and land cover classification data provided by Indonesian Geospatial Portal at http://portal.ina-sdi.or.id and software developed by BNPB. Limitation in the estimates of surface fallout, population and place names datasets may result in a significant misrepresentation of the on-the-surface situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified by ground truthing and other reliable information sources. + + + + + This report was created using InaSAFE version %s. Visit http://inasafe.org for more information. + Ce rapport a été créé avec InaSAFE version %s. Visitez http://inasafe.org pour plus d'information. + + + + Supported by DMInnovation, Geoscience Australia and the World Bank-GFDRR + + + + + People Affected + Personnes Affectées + + + + FloodEvent + + + THE GOVERNMENT OF DKI JAKARTA PROVINCE +REGIONAL DISASTER MANAGEMENT AGENCY + + LE GOUVERNEMENT DE LA PROVINCE DE DKI JAKARTA +AGENCE RÉGIONALE DE LA RÉDUCTION DES DÉSASTRES + + + + + FLOOD IMPACT REPORT FOR POPULATION + RAPPORT D'INONDATION SUR LA POPULATION + + + + Based on flood %s + Utilisant l'inondation %s + + + + Legend + Légende + + + + InaSAFE Analysis Result + Résultat de l'analyse d'InaSAFE + + + + Data Source + Source des données + + + + Contact + Contact + + + + Supported by + Soutenu par + + + + Disclaimer + Avertissement sur la limitation de responsabilité + + + + Data Sources: +1. Hazard Data + Flood: BPBD DKI Jakarta / PetaJakarta.org +2. Exposure Data + Population: Population Agency DKI Jakarta Prov. + + Source des données: +1. Couche d'aléa +Inondation: BPBD DKi Jakarta : PetaJakarta.org +2. Couche d'enjeu +Population: Population Agence DKI Jakarta Prov. + + + + + This impact estimate is automatically generated and only takes into account the population affected by flood hazard in Jakarta. The estimate is based on flood hazard data from BPBD DKI Jakarta and population exposure data from the Population Agency, DKI Jakarta Province. Limitations in the estimates of flood hazard and population may result in significant misrepresentation of the on-the-surface situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified with other reliable information sources. + L’estimation de l’impact est généré automatiquement et ne prend en compte que la population touchée par les différents niveaux de l'inondation. L’estimation est basée sur des données d'inondation BPBD DKI Jakarta, les données de recensement de l'Agence de la Population de DKI Jakarta. Les limitations dans les estimations d'inondation et la population peuvent entraîner une importante différence de la représentation du terrain comparée aux chiffres présentés ici. Par conséquent, les décisions ne doivent pas être prises uniquement sur les informations présentées ici et doivent toujours être vérifiées par vérification au sol et par d’autres sources d’information fiables. + + + + Pusat Pengendalian Operasi (Pusdalops) +BPBD Provinsi DKI Jakarta +Gedung Dinas Teknis Lt. 5 +Jl. Abdul Muis No. 66, Telp. 121 + + + + + + %s + %s + + + + Total affected population (people) + Total population affectée + + + + Estimates of IDP (people) + Estimation d'IDP (people) + + + + Relief items to be provided %s : + Matériels de secours à fournir %s : + + + + People Affected + Personnes Affectées + + + + Flood Depth (cm) + Profondeur d'inondation (cm) + + + + ShakeEvent + + + Not felt + Non perçu + + + + Weak + Faible + + + + Light + Léger + + + + Moderate + Modéré + + + + Strong + Fort + + + + Very strong + Très fort + + + + Severe + Sévère + + + + Violent + Violent + + + + Extreme + Extrême + + + + None + Aucune + + + + Very light + Très léger + + + + Mod/Heavy + Modéré/Lourd + + + + Heavy + Lourd + + + + Very heavy + Très lourd + + + + Name + Nom + + + + Population (x 1000) + Population (x 1000) + + + + Intensity + Intensité + + + + People Exposed (x 1000) + + + + + Perceived Shaking + Tremblement perçu + + + + Estimated Earthquake Impact + Impact estimé du séisme + + + + Estimated number of people exposed by each MMI level + + + + + Estimated fatalities + Victimes estimées + + + + Nearby Places + Zones proches + + + + Population count per grid cell + Dénombrement de population par cellule de la matrice (raster) + + + + This impact estimation is automatically generated and only takes into account the population and cities affected by different levels of ground shaking. The estimate is based on ground shaking data from BMKG, population count data derived by DMInnovation from worldpop.org.uk and BPS Census Data 2010, place information data provided by Indonesian Geospatial Portal at http://tanahair.indonesia.go.id and software developed by BNPB. Limitations in the estimates of ground shaking, population and place names datasets may result in significant misrepresentation of the on-the-ground situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified by ground truthing and other reliable information sources. The fatality calculation assumes that no fatalities occur for shake levels below MMI 4. Fatality counts of less than 50 are rounded down. + + + + + This report was created using InaSAFE version %s. Visit http://inasafe.org for more information. + Ce rapport a été créé avec la version %s d'InaSAFE. Rendez-vous sur http://inasafe.org pour plus d'information. + + + + Supported by the Australian Government, Geoscience Australia and the World Bank-GFDRR. + Soutenu par le gouvernement Australien, Geoscience Australie et la Banque Mondiale-GFDRR. + + + + km + km + + + + of + de + + + + bearing + supportant + + + + n/a + sans objet + + + + Elapsed time since event + Temps écoulé depuis l'événement + + + + Latitude + Latitude + + + + Longitude + Longitude + + + + Depth + Profondeur + + + + Located + Situé + + + + minute(s) + minute(s) + + + + hour(s) + heure(s) + + + + days + jours + + + + weeks + semaines + + + + Version: %s + Version: %s + + + diff --git a/realtime/i18n/inasafe_realtime_id.qm b/realtime/i18n/inasafe_realtime_id.qm new file mode 100644 index 000000000..8b9a619fb Binary files /dev/null and b/realtime/i18n/inasafe_realtime_id.qm differ diff --git a/realtime/i18n/inasafe_realtime_id.ts b/realtime/i18n/inasafe_realtime_id.ts new file mode 100644 index 000000000..1f9978094 --- /dev/null +++ b/realtime/i18n/inasafe_realtime_id.ts @@ -0,0 +1,389 @@ + + + + AshEvent + + + Volcanic Ash Impact + Dampak abu vulkanik + + + + Volcano: %s, %s + + + + + Province: %s + Provinsi: %s + + + + Alert Level: %s + + + + + Position: %s, %s; Eruption Column Height (a.s.l) - %d m + + + + + Elapsed time since event: %s hour(s) and %s minute(s) + + + + + Potential impact at each fallout level + Dampak potensial pada setiap tingkat kejatuhan + + + + Nearby places + Lokasi sekitar + + + + Land Cover Impact + Dampak Penutup Lahan + + + + The impact estimation is automatically generated and only takes into account the population, cities and land cover affected by different levels of volcanic ash fallout at surface level. The estimate is based on volcanic ash fallout data from Badan Geologi, population count data derived by DMInnovation from worldpop.org.uk, place information and land cover classification data provided by Indonesian Geospatial Portal at http://portal.ina-sdi.or.id and software developed by BNPB. Limitation in the estimates of surface fallout, population and place names datasets may result in a significant misrepresentation of the on-the-surface situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified by ground truthing and other reliable information sources. + + + + + This report was created using InaSAFE version %s. Visit http://inasafe.org for more information. + Laporan ini dibuat dengan menggunakan InaSAFE versi %s. Kunjungi http://inasafe.org untuk informasi lebih lanjut. + + + + Supported by DMInnovation, Geoscience Australia and the World Bank-GFDRR + + + + + People Affected + Penduduk Terdampak + + + + FloodEvent + + + THE GOVERNMENT OF DKI JAKARTA PROVINCE +REGIONAL DISASTER MANAGEMENT AGENCY + + PEMERINTAH PROVINSI DKI JAKARTA +BADAN PENANGGULANGAN BENCANA DAERAH + + + + FLOOD IMPACT REPORT FOR POPULATION + LAPORAN DAMPAK BANJIR PADA PENDUDUK + + + + Based on flood %s + Berdasarkan banjir %s + + + + Legend + Legenda + + + + InaSAFE Analysis Result + Hasil Analisis InaSAFE + + + + Data Source + Sumber Data + + + + Contact + Kontak + + + + Supported by + Didukung oleh + + + + Disclaimer + Ketentuan + + + + Data Sources: +1. Hazard Data + Flood: BPBD DKI Jakarta / PetaJakarta.org +2. Exposure Data + Population: Population Agency DKI Jakarta Prov. + + Sumber Data: +1. Data Ancaman +Banjir: BPBD DKI Jakarta / PetaJakarta.org +2. Data Keterpaparan +Penduduk: Dinas Kependudukan DKI Jakarta. + + + + + This impact estimate is automatically generated and only takes into account the population affected by flood hazard in Jakarta. The estimate is based on flood hazard data from BPBD DKI Jakarta and population exposure data from the Population Agency, DKI Jakarta Province. Limitations in the estimates of flood hazard and population may result in significant misrepresentation of the on-the-surface situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified with other reliable information sources. + Perkiraan dampak ini secara otomatis dibangkitkan dan hanya memperhitungkan penduduk dan kota yang terdampak banjir di Jakarta. Perkiraan ini berdasarkan data banjir dari BPBD DKI Jakarta dan data penduduk dari Dinas Kependudukan DKI Jakarta. Batasan dalam perkiraan banjir dan penduduk dapat menyebabkan kesalahan representasi dari situasi yang sebenarnya terjadi. Oleh karena itu, keputusan tidak seharusnya diambil semata-mata berdasarkan informasi yang tertera di sini dan harus selalu diverifikasi dengan sumber terpercaya lainnya. + + + + Pusat Pengendalian Operasi (Pusdalops) +BPBD Provinsi DKI Jakarta +Gedung Dinas Teknis Lt. 5 +Jl. Abdul Muis No. 66, Telp. 121 + + + + + + %s + %s + + + + Total affected population (people) + Total populasi (penduduk) terdampak + + + + Estimates of IDP (people) + Perkiraan IDP (penduduk) + + + + Relief items to be provided %s : + Barang bantuan yang perlu disediakan %s: + + + + People Affected + Penduduk Terdampak + + + + Flood Depth (cm) + Kedalaman Banjir (cm) + + + + ShakeEvent + + + Not felt + Tidak terasa + + + + Weak + Lemah + + + + Light + Agak Lemah + + + + Moderate + Sedang + + + + Strong + Kuat + + + + Very strong + Sangat Kuat + + + + Severe + Keras + + + + Violent + Sangat Keras + + + + Extreme + Ekstrim + + + + None + Tidak ada + + + + Very light + Sangat ringan + + + + Mod/Heavy + Menengah/Berat + + + + Heavy + Berat + + + + Very heavy + Sangat Berat + + + + Name + Nama + + + + Population (x 1000) + Jumlah penduduk (x 1000) + + + + Intensity + Intensitas + + + + People Exposed (x 1000) + + + + + Perceived Shaking + Getaran yang Dirasakan + + + + Estimated Earthquake Impact + Perkiraan Dampak Gempa + + + + Estimated number of people exposed by each MMI level + + + + + Estimated fatalities + Perkiraan kematian + + + + Nearby Places + Lokasi Sekitar + + + + Population count per grid cell + Jumlah populasi per grid + + + + This impact estimation is automatically generated and only takes into account the population and cities affected by different levels of ground shaking. The estimate is based on ground shaking data from BMKG, population count data derived by DMInnovation from worldpop.org.uk and BPS Census Data 2010, place information data provided by Indonesian Geospatial Portal at http://tanahair.indonesia.go.id and software developed by BNPB. Limitations in the estimates of ground shaking, population and place names datasets may result in significant misrepresentation of the on-the-ground situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified by ground truthing and other reliable information sources. The fatality calculation assumes that no fatalities occur for shake levels below MMI 4. Fatality counts of less than 50 are rounded down. + + + + + This report was created using InaSAFE version %s. Visit http://inasafe.org for more information. + Laporan ini dibuat dengan menggunakan InaSAFE versi %s. Kunjungi http://inasafe.org untuk informasi lebih lanjut. + + + + Supported by the Australian Government, Geoscience Australia and the World Bank-GFDRR. + Didukung oleh Pemerintah Australia, Geoscience Australia, dan Bank Dunia-GFDRR. + + + + km + km + + + + of + dari + + + + bearing + menanggung + + + + n/a + tidak ada informasi + + + + Elapsed time since event + Waktu berlalu sejak kejadian + + + + Latitude + Lintang + + + + Longitude + Bujur + + + + Depth + Kedalaman + + + + Located + Terletak + + + + minute(s) + menit + + + + hour(s) + jam + + + + days + hari + + + + weeks + pekan + + + + Version: %s + Versi: %s + + + diff --git a/realtime/i18n/inasafe_realtime_vi.qm b/realtime/i18n/inasafe_realtime_vi.qm new file mode 100644 index 000000000..cedc9c5d5 Binary files /dev/null and b/realtime/i18n/inasafe_realtime_vi.qm differ diff --git a/realtime/i18n/inasafe_realtime_vi.ts b/realtime/i18n/inasafe_realtime_vi.ts new file mode 100644 index 000000000..491984ff5 --- /dev/null +++ b/realtime/i18n/inasafe_realtime_vi.ts @@ -0,0 +1,383 @@ + + + + AshEvent + + + Volcanic Ash Impact + + + + + Volcano: %s, %s + + + + + Province: %s + + + + + Alert Level: %s + + + + + Position: %s, %s; Eruption Column Height (a.s.l) - %d m + + + + + Elapsed time since event: %s hour(s) and %s minute(s) + + + + + Potential impact at each fallout level + + + + + Nearby places + + + + + Land Cover Impact + + + + + The impact estimation is automatically generated and only takes into account the population, cities and land cover affected by different levels of volcanic ash fallout at surface level. The estimate is based on volcanic ash fallout data from Badan Geologi, population count data derived by DMInnovation from worldpop.org.uk, place information and land cover classification data provided by Indonesian Geospatial Portal at http://portal.ina-sdi.or.id and software developed by BNPB. Limitation in the estimates of surface fallout, population and place names datasets may result in a significant misrepresentation of the on-the-surface situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified by ground truthing and other reliable information sources. + + + + + This report was created using InaSAFE version %s. Visit http://inasafe.org for more information. + + + + + Supported by DMInnovation, Geoscience Australia and the World Bank-GFDRR + + + + + People Affected + + + + + FloodEvent + + + THE GOVERNMENT OF DKI JAKARTA PROVINCE +REGIONAL DISASTER MANAGEMENT AGENCY + + + + + + FLOOD IMPACT REPORT FOR POPULATION + + + + + Based on flood %s + + + + + Legend + + + + + InaSAFE Analysis Result + + + + + Data Source + + + + + Contact + + + + + Supported by + + + + + Disclaimer + + + + + Data Sources: +1. Hazard Data + Flood: BPBD DKI Jakarta / PetaJakarta.org +2. Exposure Data + Population: Population Agency DKI Jakarta Prov. + + + + + + This impact estimate is automatically generated and only takes into account the population affected by flood hazard in Jakarta. The estimate is based on flood hazard data from BPBD DKI Jakarta and population exposure data from the Population Agency, DKI Jakarta Province. Limitations in the estimates of flood hazard and population may result in significant misrepresentation of the on-the-surface situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified with other reliable information sources. + + + + + Pusat Pengendalian Operasi (Pusdalops) +BPBD Provinsi DKI Jakarta +Gedung Dinas Teknis Lt. 5 +Jl. Abdul Muis No. 66, Telp. 121 + + + + + + %s + + + + + Total affected population (people) + + + + + Estimates of IDP (people) + + + + + Relief items to be provided %s : + + + + + People Affected + + + + + Flood Depth (cm) + + + + + ShakeEvent + + + Not felt + + + + + Weak + + + + + Light + + + + + Moderate + + + + + Strong + + + + + Very strong + + + + + Severe + + + + + Violent + + + + + Extreme + + + + + None + + + + + Very light + + + + + Mod/Heavy + + + + + Heavy + + + + + Very heavy + + + + + Name + + + + + Population (x 1000) + Dân số (x1000) + + + + Intensity + + + + + People Exposed (x 1000) + + + + + Perceived Shaking + + + + + Estimated Earthquake Impact + + + + + Estimated number of people exposed by each MMI level + + + + + Estimated fatalities + + + + + Nearby Places + + + + + Population count per grid cell + Số dân trong mỗi ô lưới + + + + This impact estimation is automatically generated and only takes into account the population and cities affected by different levels of ground shaking. The estimate is based on ground shaking data from BMKG, population count data derived by DMInnovation from worldpop.org.uk and BPS Census Data 2010, place information data provided by Indonesian Geospatial Portal at http://tanahair.indonesia.go.id and software developed by BNPB. Limitations in the estimates of ground shaking, population and place names datasets may result in significant misrepresentation of the on-the-ground situation in the figures shown here. Consequently, decisions should not be made solely on the information presented here and should always be verified by ground truthing and other reliable information sources. The fatality calculation assumes that no fatalities occur for shake levels below MMI 4. Fatality counts of less than 50 are rounded down. + + + + + This report was created using InaSAFE version %s. Visit http://inasafe.org for more information. + + + + + Supported by the Australian Government, Geoscience Australia and the World Bank-GFDRR. + + + + + km + + + + + of + + + + + bearing + + + + + n/a + + + + + Elapsed time since event + + + + + Latitude + Vĩ độ + + + + Longitude + Kinh độ + + + + Depth + độ sâu + + + + Located + + + + + minute(s) + phút (s) + + + + hour(s) + giờ (s) + + + + days + ngày + + + + weeks + tuần + + + + Version: %s + phiên bản : %s + + + diff --git a/realtime/scripts/create_pro_file.sh b/realtime/scripts/create_pro_file.sh new file mode 100755 index 000000000..8f1e1477e --- /dev/null +++ b/realtime/scripts/create_pro_file.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +SAFE_PYFILES=`find realtime -name "**.py**" | grep -v "pyc$" | grep -v test` +UI_FILES=`find realtime -name "**.ui**"` + +PRO_FILE=inasafe.pro + +echo "SOURCES = \\" > ${PRO_FILE} + +# First add the SAFE files to the pro file +for FILE in ${SAFE_PYFILES} +do + echo " ${FILE} \\" >> ${PRO_FILE} +done + +echo " +FORMS = \\" >> ${PRO_FILE} + +LAST_FILE="" +for FILE in ${UI_FILES} +do + if [ ! -z ${LAST_FILE} ] + then + echo " ${LAST_FILE} \\" >> ${PRO_FILE} + fi + LAST_FILE=${FILE} +done +if [ ! -z ${LAST_FILE} ] +then + echo " ${LAST_FILE}" >> ${PRO_FILE} +fi + +# Finally define which languages we are translating for + +echo " +TRANSLATIONS = realtime/i18n/inasafe_realtime_id.ts \\ + realtime/i18n/inasafe_realtime_fr.ts \\ + realtime/i18n/inasafe_realtime_es_ES.ts \\ + realtime/i18n/inasafe_realtime_vi.ts \\ + realtime/i18n/inasafe_realtime_af.ts" >> ${PRO_FILE} diff --git a/realtime/scripts/update-strings.sh b/realtime/scripts/update-strings.sh new file mode 100755 index 000000000..d3bb11d1a --- /dev/null +++ b/realtime/scripts/update-strings.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +LOCALES=$* + +python_safe=`find realtime/ -regex ".*\(ui\|py\)$" -type f` + +# update .ts +echo "Please provide translations by editing the translation files below:" +for LOCALE in ${LOCALES} +do +echo "realtime/i18n/inasafe_"${LOCALE}".ts" +# Note we don't use pylupdate with qt .pro file approach as it is flakey +# about what is made available. +set -x +pylupdate4 -noobsolete ${python_safe} -ts realtime/i18n/inasafe_realtime_${LOCALE}.ts +done + diff --git a/realtime/test/test_utilities.py b/realtime/test/test_utilities.py index 5cf6ae50b..7092042a0 100644 --- a/realtime/test/test_utilities.py +++ b/realtime/test/test_utilities.py @@ -22,6 +22,8 @@ import unittest import datetime + +from PyQt4.QtCore import QObject, QCoreApplication from safe.common.utilities import log_file_path from realtime.utilities import ( base_data_dir,