rvar

Crates.iorvar
lib.rsrvar
version0.1.5
sourcesrc
created_at2024-06-13 10:26:59.192543
updated_at2024-08-29 09:38:38.331514
descriptionextract_i18n
homepagehttps://github.com/i18n-site/rust/tree/main/rvar
repositoryhttps://github.com/i18n-site/rust.git
max_upload_size
id1270494
size5,547
i18n.site (i18nsite)

documentation

README

extract_i18n

use aok::{Result, OK};
use static_init::constructor;

#[constructor(0)]
extern "C" fn init() {
  loginit::init()
}

#[test]
fn test() -> Result<()> {
  let s = "12345${ I18N.doc } ${12345678}12${I18N.xxx}12";
  let r = rvar::extract(s);

  let r = rvar::replace(s, &r.range[..], |key| {
    dbg!(key);
    key[5..].into()
  });
  dbg!(r);
  OK
}

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。

Commit count: 21

cargo fmt