@ POST @ Consumes ( "multipart/form-data" ) @ RequiresPermissions ( I18nPermissions . KEY_WRITE ) public Response importTranslations ( FormDataMultiPart multiPart ) { WebAssertions . assertNotNull ( multiPart , "Missing input file" ) ; int importedKeys = 0 ; for ( BodyPart bodyPart : multiPart . getBodyParts ( ) ) { importedKeys += importFile ( bodyPart ) ; } String importedKeysMessage = String . format ( LOADED_KEYS_MESSAGE , importedKeys ) ; LOGGER . debug ( importedKeysMessage ) ; return Response . ok ( importedKeysMessage , MediaType . TEXT_PLAIN_TYPE ) . build ( ) ; }
Imports one or more CSV files containing i18n keys with their translations .