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