pub struct JsParser;Expand description
Parser for JavaScript translation files
Supports both ES6 exports and CommonJS formats:
export default { ... }module.exports = { ... }
Implementations§
Source§impl JsParser
impl JsParser
Sourcepub fn parse_file(file_path: &Path) -> Result<Vec<TranslationEntry>>
pub fn parse_file(file_path: &Path) -> Result<Vec<TranslationEntry>>
Parse a JavaScript file and extract translation entries
Sourcepub fn parse_content(
content: &str,
file_path: &Path,
) -> Result<Vec<TranslationEntry>>
pub fn parse_content( content: &str, file_path: &Path, ) -> Result<Vec<TranslationEntry>>
Parse JavaScript content and extract translation entries
Sourcepub fn contains_query(file_path: &Path, query: &str) -> Result<bool>
pub fn contains_query(file_path: &Path, query: &str) -> Result<bool>
Check if a file contains the query and if it’s in a translation structure
Sourcepub fn parse_file_with_query(
file_path: &Path,
query: Option<&str>,
) -> Result<Vec<TranslationEntry>>
pub fn parse_file_with_query( file_path: &Path, query: Option<&str>, ) -> Result<Vec<TranslationEntry>>
Parse file with query optimization (only parse if query might be present)
Auto Trait Implementations§
impl Freeze for JsParser
impl RefUnwindSafe for JsParser
impl Send for JsParser
impl Sync for JsParser
impl Unpin for JsParser
impl UnwindSafe for JsParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more