This commit is contained in:
2026-01-24 12:15:23 +01:00
parent b5e7ab5c48
commit af095684a1
37 changed files with 2595 additions and 85 deletions

31
dioxus-i18n/src/error.rs Normal file
View File

@@ -0,0 +1,31 @@
use thiserror::Error;
#[derive(Clone, Debug, Error)]
pub enum Error {
#[error("invalid message id: '{0}'")]
InvalidMessageId(String),
#[error("message id not found for key: '{0}'")]
MessageIdNotFound(String),
#[error("attribute id not found for key: '{0}'")]
AttributeIdNotFound(String),
#[error("message pattern not found for key: '{0}'")]
MessagePatternNotFound(String),
#[error("fluent errors during lookup:\n{0}")]
FluentErrorsDetected(String),
#[error("failed to read locale resource from path: {0}")]
LocaleResourcePathReadFailed(String),
#[error("fallback for \"{0}\" must have locale")]
FallbackMustHaveLocale(String),
#[error("language id cannot be determined - reason: {0}")]
InvalidLanguageId(String),
#[error("invalid path: {0}")]
InvalidPath(String),
}