{"thread":{"id":"30728","subject":"[PATCH] Use system_path to find 'po'-dir to resolve relative paths","startedAt":"2012-06-06T13:01:15Z","lastAt":"2012-06-06T18:28:52Z","messageCount":3,"participants":["Vincent van Ravesteijn","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"192982","messageId":"1338987675-7388-1-git-send-email-vfr@lyx.org","threadId":"30728","inReplyTo":null,"subject":"[PATCH] Use system_path to find 'po'-dir to resolve relative paths","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2012-06-06T13:01:15Z","receivedAt":"2012-06-06T13:01:15Z","isPatch":true,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"If the specified path for the 'po'-files is a relative path and if\nRUNTIME_PREFIX is set, system_path must be used to resolve the directory relative to the executable.\n\nSigned-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n---\n gettext.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/gettext.c b/gettext.c\nindex f75bca7..632ccf8 100644\n--- a/gettext.c\n+++ b/gettext.c\n@@ -4,6 +4,7 @@\n \n #include \"git-compat-util.h\"\n #include \"gettext.h\"\n+#include \"exec_cmd.h\"\n \n #ifndef NO_GETTEXT\n #\tinclude <locale.h>\n@@ -123,7 +124,7 @@ void git_setup_gettext(void)\n \n \tif (!podir)\n \t\tpodir = GIT_LOCALE_PATH;\n-\tbindtextdomain(\"git\", podir);\n+\tbindtextdomain(\"git\", system_path(podir));\n \tsetlocale(LC_MESSAGES, \"\");\n \tinit_gettext_charset(\"git\");\n \ttextdomain(\"git\");\n-- \n1.7.9.msysgit.0\n"},{"id":"192983","messageId":"1338987809-7212-1-git-send-email-vfr@lyx.org","threadId":"30728","inReplyTo":"1338987675-7388-1-git-send-email-vfr@lyx.org","subject":"[PATCH] git-upload-pack: Setup exec_path before gettext","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2012-06-06T13:03:29Z","receivedAt":"2012-06-06T13:03:29Z","isPatch":true,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"If RUNTIME_PREFIX is set, git_setup_gettext() uses system_path() to find\nthe directory with po-files. The function system_path() needs the\nexec_path so this needs to be setup first before setting up gettext().\n\nSigned-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n---\n upload-pack.c |    5 +++--\n 1 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/upload-pack.c b/upload-pack.c\nindex bb08e2e..f5ba770 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -791,10 +791,11 @@ int main(int argc, char **argv)\n \tint i;\n \tint strict = 0;\n \n-\tgit_setup_gettext();\n-\n \tpacket_trace_identity(\"upload-pack\");\n \tgit_extract_argv0_path(argv[0]);\n+\t\n+\tgit_setup_gettext();\n+\n \tread_replace_refs = 0;\n \n \tfor (i = 1; i < argc; i++) {\n-- \n1.7.9.msysgit.0\n"},{"id":"193005","messageId":"7v7gvkmh0b.fsf@alter.siamese.dyndns.org","threadId":"30728","inReplyTo":"1338987675-7388-1-git-send-email-vfr@lyx.org","subject":"Re: [PATCH] Use system_path to find 'po'-dir to resolve relative paths","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-06T18:28:52Z","receivedAt":"2012-06-06T18:28:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Vincent van Ravesteijn <vfr@lyx.org> writes:\n\n> If the specified path for the 'po'-files is a relative path and if\n> RUNTIME_PREFIX is set, system_path must be used to resolve the directory relative to the executable.\n>\n> Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n> ---\n\nHrm, I'd prefer to see anything that involves RUNTIME_PREFIX first\ntested in msysgit tree and then fed to me through them.\n\nThanks.\n\n>  gettext.c |    3 ++-\n>  1 files changed, 2 insertions(+), 1 deletions(-)\n>\n> diff --git a/gettext.c b/gettext.c\n> index f75bca7..632ccf8 100644\n> --- a/gettext.c\n> +++ b/gettext.c\n> @@ -4,6 +4,7 @@\n>  \n>  #include \"git-compat-util.h\"\n>  #include \"gettext.h\"\n> +#include \"exec_cmd.h\"\n>  \n>  #ifndef NO_GETTEXT\n>  #\tinclude <locale.h>\n> @@ -123,7 +124,7 @@ void git_setup_gettext(void)\n>  \n>  \tif (!podir)\n>  \t\tpodir = GIT_LOCALE_PATH;\n> -\tbindtextdomain(\"git\", podir);\n> +\tbindtextdomain(\"git\", system_path(podir));\n>  \tsetlocale(LC_MESSAGES, \"\");\n>  \tinit_gettext_charset(\"git\");\n>  \ttextdomain(\"git\");\n"}]}