Fix build methods I think

pull/11/head
asonix 6 years ago
parent 0f4774cbe0
commit 291de4f122
No known key found for this signature in database
GPG Key ID: 6986797E36BFA1D4

@ -125,10 +125,12 @@ pub fn i18n(lang: Vec<&'static str>) -> Translations {
}
#[cfg(feature = "build")]
pub fn update_po(domain: &str) {
pub fn update_po(domain: &str, locales: &[String]) {
use std::{path::Path, process::Command};
let pot_path = Path::new("po").join(format!("{}.pot", domain));
for lang in get_locales() {
for lang in locales {
let po_path = Path::new("po").join(format!("{}.po", lang.clone()));
if po_path.exists() && po_path.is_file() {
println!("Updating {}", lang.clone());
@ -166,8 +168,10 @@ pub fn update_po(domain: &str) {
/// Transforms all the .po files in the `po` directory of your project
#[cfg(feature = "build")]
fn compile_po() {
for lang in get_locales() {
pub fn compile_po(domain: &str, locales: &[String]) {
use std::{path::Path, process::Command};
for lang in locales {
let po_path = Path::new("po").join(format!("{}.po", lang.clone()));
let mo_dir = Path::new("translations")
.join(lang.clone())

Loading…
Cancel
Save