[freeside-commits] branch FREESIDE_3_BRANCH updated. 0add8843918784300967a321325d48251e131c44
Mark Wells
mark at 420.am
Wed Feb 12 14:25:54 PST 2014
The branch, FREESIDE_3_BRANCH has been updated
via 0add8843918784300967a321325d48251e131c44 (commit)
from 9c423ca4410eb737d3c37c52265b4b361593a210 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0add8843918784300967a321325d48251e131c44
Author: Mark Wells <mark at freeside.biz>
Date: Wed Feb 12 14:24:40 2014 -0800
script to insert CDR header strings into msgcat, #27276
diff --git a/bin/translate-insert-cdr-headers b/bin/translate-insert-cdr-headers
new file mode 100755
index 0000000..b7f1ce0
--- /dev/null
+++ b/bin/translate-insert-cdr-headers
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::Conf;
+use FS::Record qw(qsearchs);
+use FS::cdr;
+
+sub usage {
+ "usage:
+ translate-insert-cdr-headers <user> <locale>
+";
+}
+
+my $user = shift or die usage();
+adminsuidsetup($user);
+my $locale = shift or die usage();
+
+$FS::UID::AutoCommit = 1;
+
+my %formats = FS::cdr::invoice_formats();
+my @strings = map { FS::cdr::invoice_header($_) } keys %formats;
+foreach my $string (@strings) {
+ print "$string ... ";
+ if ( qsearchs('msgcat', {
+ locale => $locale,
+ msgcode => $string,
+ }) ) {
+ print "already exists.\n";
+ } else {
+ my $newmsgcat = FS::msgcat->new(
+ {
+ locale => $locale,
+ msgcode => $string,
+ msg => $string,
+ });
+ my $error = $newmsgcat->insert;
+ print (($error || "inserted."). "\n");
+ }
+}
-----------------------------------------------------------------------
Summary of changes:
bin/translate-insert-cdr-headers | 40 ++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
create mode 100755 bin/translate-insert-cdr-headers
More information about the freeside-commits
mailing list