Skip to main content

Locale

Struct Locale 

Source
pub struct Locale {
Show 16 fields pub report_title: &'static str, pub day_type_working: &'static str, pub workday_length: &'static str, pub header_day: &'static str, pub header_start: &'static str, pub header_end: &'static str, pub header_hours: &'static str, pub header_result: &'static str, pub total_worked: &'static str, pub comment: &'static str, pub work_on_task: &'static str, pub work_generic: &'static str, pub break_label: &'static str, pub months: [&'static str; 12], pub weekdays: [&'static str; 7], pub date_format: &'static str,
}
Expand description

A complete set of localized strings for one language.

All fields are &'static str because the tables are compiled into the binary. The work_on_task field contains a {task} placeholder that is replaced with the actual task name at render time.

Fields§

§report_title: &'static str

Report title shown in the merged header cell (e.g. “Отчет за день”).

§day_type_working: &'static str

Label for a regular working day (e.g. “рабочий”).

§workday_length: &'static str

Caption for the workday-length header cell.

§header_day: &'static str

Column header spanning the start/end time columns (e.g. “День”).

§header_start: &'static str

Header for the interval start-time column.

§header_end: &'static str

Header for the interval end-time column.

§header_hours: &'static str

Header for the optional “hours” column.

§header_result: &'static str

Header for the optional “result” column.

§total_worked: &'static str

Label for the total worked-hours footer row.

§comment: &'static str

Label preceding the free-form comment box.

§work_on_task: &'static str

Work description template; {task} is replaced with the task name.

§work_generic: &'static str

Generic work label used when a task has no name.

§break_label: &'static str

Label written for hours (or parts of hours) spent on a break/pause.

§months: [&'static str; 12]

Nominative month names, indexed 0 (January) through 11 (December).

§weekdays: [&'static str; 7]

Weekday names, indexed 0 (Monday) through 6 (Sunday).

§date_format: &'static str

chrono date format string used for the date header cell.

Implementations§

Source§

impl Locale

Source

pub fn for_language(language: Language) -> &'static Locale

Returns the static Locale table for the given language.

Source

pub fn work_text(&self, task_name: &str) -> String

Builds a work description for a task name using the work_on_task template, falling back to Locale::work_generic for empty names.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more