diff options
Diffstat (limited to 'server/api')
| -rw-r--r-- | server/api/src/api_model.rs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/server/api/src/api_model.rs b/server/api/src/api_model.rs index 7602480..7dd2a20 100644 --- a/server/api/src/api_model.rs +++ b/server/api/src/api_model.rs @@ -265,3 +265,41 @@ pub struct UserKeys { pub more: bool, pub keys: Vec<UserKey>, } + +#[derive(Debug, Deserialize, PartialEq, Serialize, ToSchema)] +pub struct LocalizationString { + #[schema(example = "IDS_GENERIC_WELCOME")] + pub id: String, + #[schema(example = "strings/strings.grd")] + pub file: String, + #[schema(example = "Generic greating")] + pub description: String, + #[schema(example = "This should be a positive greating")] + pub meaning: String, + #[schema(example = "Hello!")] + pub source: String, + pub placeholders: Vec<LocalizationPlaceholder>, + pub placeholder_offset: Vec<usize>, + #[schema(example = "123456")] + pub translation_id: i64, + pub translations: Vec<TranslationString>, +} + +#[derive(Debug, Deserialize, PartialEq, Serialize, ToSchema)] +pub struct LocalizationPlaceholder { + #[schema(example = "NAME")] + pub id: String, + #[schema(example = "%1$d")] + pub content: String, + #[schema(example = "42")] + pub example: String, +} + +#[derive(Debug, Deserialize, PartialEq, Serialize, ToSchema)] +pub struct TranslationString { + #[schema(example = "sv")] + pub language: String, + #[schema(example = "Hej!")] + pub translation: String, + pub placeholder_offset: Vec<usize>, +} |
