summaryrefslogtreecommitdiff
path: root/src/International.c
blob: eb03bb2fe45e52e48328e2238ceaa29f195819f4 (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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/* International.c generated by valac 0.34.1, 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) {
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
#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"
	_tmp0_ = locale;
#line 16 "/home/jens/Source/shotwell/src/International.vala"
	setlocale (LC_ALL, _tmp0_);
#line 18 "/home/jens/Source/shotwell/src/International.vala"
	_tmp1_ = package_name;
#line 18 "/home/jens/Source/shotwell/src/International.vala"
	_tmp2_ = args;
#line 18 "/home/jens/Source/shotwell/src/International.vala"
	_tmp2__length1 = args_length1;
#line 18 "/home/jens/Source/shotwell/src/International.vala"
	_tmp3_ = international_support_get_langpack_dir_path (_tmp2_, _tmp2__length1);
#line 18 "/home/jens/Source/shotwell/src/International.vala"
	_tmp4_ = _tmp3_;
#line 18 "/home/jens/Source/shotwell/src/International.vala"
	bindtextdomain (_tmp1_, _tmp4_);
#line 18 "/home/jens/Source/shotwell/src/International.vala"
	_g_free0 (_tmp4_);
#line 19 "/home/jens/Source/shotwell/src/International.vala"
	_tmp5_ = package_name;
#line 19 "/home/jens/Source/shotwell/src/International.vala"
	bind_textdomain_codeset (_tmp5_, "UTF-8");
#line 20 "/home/jens/Source/shotwell/src/International.vala"
	_tmp6_ = package_name;
#line 20 "/home/jens/Source/shotwell/src/International.vala"
	textdomain (_tmp6_);
#line 70 "International.c"
}


gchar* international_support_get_langpack_dir_path (gchar** args, int args_length1) {
	gchar* result = NULL;
	GFile* local_langpack_dir = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	GFile* _tmp4_ = NULL;
	GFile* _tmp5_ = NULL;
	GFile* _tmp6_ = NULL;
	GFile* _tmp7_ = NULL;
	GFile* _tmp8_ = NULL;
	GFile* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	GFile* _tmp11_ = NULL;
	gboolean _tmp12_ = FALSE;
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp0_ = args;
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp0__length1 = args_length1;
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp1_ = _tmp0_[0];
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp2_ = g_find_program_in_path (_tmp1_);
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp3_ = _tmp2_;
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp4_ = g_file_new_for_path (_tmp3_);
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp5_ = _tmp4_;
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp6_ = g_file_get_parent (_tmp5_);
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp7_ = _tmp6_;
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp8_ = g_file_get_child (_tmp7_, "locale-langpack");
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_tmp9_ = _tmp8_;
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_g_object_unref0 (_tmp7_);
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_g_object_unref0 (_tmp5_);
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	_g_free0 (_tmp3_);
#line 24 "/home/jens/Source/shotwell/src/International.vala"
	local_langpack_dir = _tmp9_;
#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_query_exists (_tmp11_, NULL);
#line 28 "/home/jens/Source/shotwell/src/International.vala"
	if (_tmp12_) {
#line 127 "International.c"
		GFile* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
#line 28 "/home/jens/Source/shotwell/src/International.vala"
		_tmp13_ = local_langpack_dir;
#line 28 "/home/jens/Source/shotwell/src/International.vala"
		_tmp14_ = g_file_get_path (_tmp13_);
#line 28 "/home/jens/Source/shotwell/src/International.vala"
		_g_free0 (_tmp10_);
#line 28 "/home/jens/Source/shotwell/src/International.vala"
		_tmp10_ = _tmp14_;
#line 138 "International.c"
	} else {
		gchar* _tmp15_ = NULL;
#line 29 "/home/jens/Source/shotwell/src/International.vala"
		_tmp15_ = g_strdup (INTERNATIONAL_SUPPORT_LANGUAGE_SUPPORT_DIRECTORY);
#line 29 "/home/jens/Source/shotwell/src/International.vala"
		_g_free0 (_tmp10_);
#line 29 "/home/jens/Source/shotwell/src/International.vala"
		_tmp10_ = _tmp15_;
#line 147 "International.c"
	}
#line 28 "/home/jens/Source/shotwell/src/International.vala"
	result = _tmp10_;
#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 155 "International.c"
}