summaryrefslogtreecommitdiff
path: root/src/International.c
blob: 01f33dd7059b64d580f9d9e37066191fd2f9d397 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* International.c generated by valac 0.40.4, the Vala compiler
 * generated from International.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU LGPL (version 2.1 or later).
 * See the COPYING file in this distribution.
 */


#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))



#define TRANSLATABLE "translatable"
#define INTERNATIONAL_SUPPORT_SYSTEM_LOCALE ""
#define INTERNATIONAL_SUPPORT_LANGUAGE_SUPPORT_DIRECTORY _LANG_SUPPORT_DIR
void international_support_init (const gchar* package_name,
                                 gchar** args,
                                 int args_length1,
                                 const gchar* locale);
gchar* international_support_get_langpack_dir_path (gchar** args,
                                                    int args_length1);


void
international_support_init (const gchar* package_name,
                            gchar** args,
                            int args_length1,
                            const gchar* locale)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
#line 15 "/home/jens/Source/shotwell/src/International.vala"
	g_return_if_fail (package_name != NULL);
#line 15 "/home/jens/Source/shotwell/src/International.vala"
	g_return_if_fail (locale != NULL);
#line 16 "/home/jens/Source/shotwell/src/International.vala"
	setlocale (LC_ALL, locale);
#line 18 "/home/jens/Source/shotwell/src/International.vala"
	_tmp0_ = international_support_get_langpack_dir_path (args, args_length1);
#line 18 "/home/jens/Source/shotwell/src/International.vala"
	_tmp1_ = _tmp0_;
#line 18 "/home/jens/Source/shotwell/src/International.vala"
	bindtextdomain (package_name, _tmp1_);
#line 18 "/home/jens/Source/shotwell/src/International.vala"
	_g_free0 (_tmp1_);
#line 19 "/home/jens/Source/shotwell/src/International.vala"
	bind_textdomain_codeset (package_name, "UTF-8");
#line 20 "/home/jens/Source/shotwell/src/International.vala"
	textdomain (package_name);
#line 62 "International.c"
}


gchar*
international_support_get_langpack_dir_path (gchar** args,
                                             int args_length1)
{
	gchar* result = NULL;
	GFile* local_langpack_dir = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GFile* _tmp3_;
	GFile* _tmp4_;
	GFile* _tmp5_;
	GFile* _tmp6_;
	GFile* _tmp7_;
	GFile* _tmp8_;
	gchar* _tmp9_ = NULL;
	GFile* _tmp10_;
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp0_ = args[0];
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp1_ = g_find_program_in_path (_tmp0_);
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp2_ = _tmp1_;
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp3_ = g_file_new_for_path (_tmp2_);
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp4_ = _tmp3_;
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp5_ = g_file_get_parent (_tmp4_);
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp6_ = _tmp5_;
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp7_ = g_file_get_child (_tmp6_, "locale-langpack");
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp8_ = _tmp7_;
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_g_object_unref0 (_tmp6_);
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_g_object_unref0 (_tmp4_);
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_g_free0 (_tmp2_);
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	local_langpack_dir = _tmp8_;
#line 28 "/home/jens/Source/shotwell/src/International.vala"
	_tmp10_ = local_langpack_dir;
#line 28 "/home/jens/Source/shotwell/src/International.vala"
	if (g_file_query_exists (_tmp10_, NULL)) {
#line 113 "International.c"
		GFile* _tmp11_;
		gchar* _tmp12_;
#line 28 "/home/jens/Source/shotwell/src/International.vala"
		_tmp11_ = local_langpack_dir;
#line 28 "/home/jens/Source/shotwell/src/International.vala"
		_tmp12_ = g_file_get_path (_tmp11_);
#line 28 "/home/jens/Source/shotwell/src/International.vala"
		_g_free0 (_tmp9_);
#line 28 "/home/jens/Source/shotwell/src/International.vala"
		_tmp9_ = _tmp12_;
#line 124 "International.c"
	} else {
		gchar* _tmp13_;
#line 29 "/home/jens/Source/shotwell/src/International.vala"
		_tmp13_ = g_strdup (INTERNATIONAL_SUPPORT_LANGUAGE_SUPPORT_DIRECTORY);
#line 29 "/home/jens/Source/shotwell/src/International.vala"
		_g_free0 (_tmp9_);
#line 29 "/home/jens/Source/shotwell/src/International.vala"
		_tmp9_ = _tmp13_;
#line 133 "International.c"
	}
#line 28 "/home/jens/Source/shotwell/src/International.vala"
	result = _tmp9_;
#line 28 "/home/jens/Source/shotwell/src/International.vala"
	_g_object_unref0 (local_langpack_dir);
#line 28 "/home/jens/Source/shotwell/src/International.vala"
	return result;
#line 141 "International.c"
}