From 84a93491b8600737511fcf32370e596fbaa37b56 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Tue, 11 Aug 2009 08:57:01 +0200 Subject: s3 net: i18n support for net usershare --- source3/locale/net/genmsg | 2 +- source3/utils/net_usershare.c | 236 ++++++++++++++++++++++++++---------------- 2 files changed, 147 insertions(+), 91 deletions(-) diff --git a/source3/locale/net/genmsg b/source3/locale/net/genmsg index 4c98cf3fdc..fdea9774e7 100755 --- a/source3/locale/net/genmsg +++ b/source3/locale/net/genmsg @@ -33,7 +33,7 @@ FILES=`add_basedir_to_filelist ../../utils net.c net_ads.c net_ads_gpo.c \ net_registry_util.c net_rpc.c net_rpc_audit.c net_rpc_join.c \ net_rpc_printer.c net_rpc_registry.c net_rpc_rights.c net_rpc_samsync.c \ net_rpc_service.c net_rpc_sh_acct.c net_rpc_shell.c net_sam.c \ - net_share.c net_status.c net_time.c net_user.c` + net_share.c net_status.c net_time.c net_user.c net_usershare.c` LANGS="af ar bg bn bs ca cs cy da de el en_GB en_US es et fi fr gl gu he hi hr hu id it ja ka km ko lo lt mk mr nb nl pa pl pt_BR pt ro ru si sk sl sr diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c index 6eacb1386c..edcb7df5cb 100644 --- a/source3/utils/net_usershare.c +++ b/source3/utils/net_usershare.c @@ -26,17 +26,17 @@ struct { enum usershare_err us_err; } us_errs [] = { {"",USERSHARE_OK}, - {"Malformed usershare file", USERSHARE_MALFORMED_FILE}, - {"Bad version number", USERSHARE_BAD_VERSION}, - {"Malformed path entry", USERSHARE_MALFORMED_PATH}, - {"Malformed comment entryfile", USERSHARE_MALFORMED_COMMENT_DEF}, - {"Malformed acl definition", USERSHARE_MALFORMED_ACL_DEF}, - {"Acl parse error", USERSHARE_ACL_ERR}, - {"Path not absolute", USERSHARE_PATH_NOT_ABSOLUTE}, - {"Path is denied", USERSHARE_PATH_IS_DENIED}, - {"Path not allowed", USERSHARE_PATH_NOT_ALLOWED}, - {"Path is not a directory", USERSHARE_PATH_NOT_DIRECTORY}, - {"System error", USERSHARE_POSIX_ERR}, + {N_("Malformed usershare file"), USERSHARE_MALFORMED_FILE}, + {N_("Bad version number"), USERSHARE_BAD_VERSION}, + {N_("Malformed path entry"), USERSHARE_MALFORMED_PATH}, + {N_("Malformed comment entryfile"), USERSHARE_MALFORMED_COMMENT_DEF}, + {N_("Malformed acl definition"), USERSHARE_MALFORMED_ACL_DEF}, + {N_("Acl parse error"), USERSHARE_ACL_ERR}, + {N_("Path not absolute"), USERSHARE_PATH_NOT_ABSOLUTE}, + {N_("Path is denied"), USERSHARE_PATH_IS_DENIED}, + {N_("Path not allowed"), USERSHARE_PATH_NOT_ALLOWED}, + {N_("Path is not a directory"), USERSHARE_PATH_NOT_DIRECTORY}, + {N_("System error"), USERSHARE_POSIX_ERR}, {NULL,(enum usershare_err)-1} }; @@ -52,7 +52,7 @@ static const char *get_us_error_code(enum usershare_err us_err) idx++; } - result = talloc_asprintf(talloc_tos(), "Usershare error code (0x%x)", + result = talloc_asprintf(talloc_tos(), _("Usershare error code (0x%x)"), (unsigned int)us_err); SMB_ASSERT(result != NULL); return result; @@ -63,7 +63,7 @@ static const char *get_us_error_code(enum usershare_err us_err) static int net_usershare_add_usage(struct net_context *c, int argc, const char **argv) { char chr = *lp_winbind_separator(); - d_printf( + d_printf(_( "net usershare add [-l|--long] [] [] []\n" "\tAdds the specified share name for this user.\n" "\t is the new share name.\n" @@ -76,50 +76,50 @@ static int net_usershare_add_usage(struct net_context *c, int argc, const char * "\t\tname may be a domain user or group. For local users use the local server name " "instead of \"DOMAIN\"\n" "\t\tThe default acl is \"Everyone:r\" which allows everyone read-only access.\n" - "\tAdd -l or --long to print the info on the newly added share.\n", + "\tAdd -l or --long to print the info on the newly added share.\n"), chr, chr ); return -1; } static int net_usershare_delete_usage(struct net_context *c, int argc, const char **argv) { - d_printf( + d_printf(_( "net usershare delete \n" - "\tdeletes the specified share name for this user.\n"); + "\tdeletes the specified share name for this user.\n")); return -1; } static int net_usershare_info_usage(struct net_context *c, int argc, const char **argv) { - d_printf( + d_printf(_( "net usershare info [-l|--long] [wildcard sharename]\n" "\tPrints out the path, comment and acl elements of shares that match the wildcard.\n" "\tBy default only gives info on shares owned by the current user\n" "\tAdd -l or --long to apply this to all shares\n" - "\tOmit the sharename or use a wildcard of '*' to see all shares\n"); + "\tOmit the sharename or use a wildcard of '*' to see all shares\n")); return -1; } static int net_usershare_list_usage(struct net_context *c, int argc, const char **argv) { - d_printf( + d_printf(_( "net usershare list [-l|--long] [wildcard sharename]\n" "\tLists the names of all shares that match the wildcard.\n" "\tBy default only lists shares owned by the current user\n" "\tAdd -l or --long to apply this to all shares\n" - "\tOmit the sharename or use a wildcard of '*' to see all shares\n"); + "\tOmit the sharename or use a wildcard of '*' to see all shares\n")); return -1; } int net_usershare_usage(struct net_context *c, int argc, const char **argv) { - d_printf("net usershare add [] [] [] to " + d_printf(_("net usershare add [] [] [] to " "add or change a user defined share.\n" "net usershare delete to delete a user defined share.\n" "net usershare info [-l|--long] [wildcard sharename] to print info about a user defined share.\n" "net usershare list [-l|--long] [wildcard sharename] to list user defined shares.\n" "net usershare help\n" - "\nType \"net usershare help