summary refs log tree commit diff stats
path: root/.tx/howto.md
blob: d9fe5a036139f39b3bc58c647bc02501563054f3 (plain) (blame)
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
Go to the [Transifex client documentation](http://help.transifex.com/features/client/index.html) for more info.

## Initializing a new project on Transifex

<pre>
tx init
tx set --auto-local -r hexchat.main "po\<lang>.po" --source-lang en --source-file po\hexchat.pot --execute
</pre>

Append `type = PO` to _.tx\config_.

Push the resources to Transifex:

<pre>
tx push --source --translation
</pre>


## Updating online translations with the template

Regenerate the source file ( _hexchat.pot_ ) on a Unix machine:

<pre>
rm po/hexchat.pot && ./autogen.sh && ./configure --enable-nls && cd src/common && make textevents.h && cd../.. && make
</pre>

Push the updated source file to Transifex (this automatically updates all translation files):

<pre>
tx push --source
</pre>


## Updating the repo with online translations

Update local copy with Transifex updates:

<pre>
tx pull
</pre>

Update GitHub repo:

<pre>git add po/
git commit
git push
</pre>


## Updating just one translation with local changes

<pre>
tx push --translation --language xy
</pre>

Where _xy_ is the language code.


## Forcing translation updates

<pre>
tx pull --force
</pre>

This might be required when the repo is freshly cloned and thus timestamps are newer than on Transifex.
fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/* X-Chat
 * Copyright (C) 1998 Peter Zelezny.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "fe-gtk.h"

#include "../common/hexchat.h"
#include "../common/hexchatc.h"
#include "gtkutil.h"
#include "ascii.h"
#include "maingui.h"

static const unsigned char table[]=
{
/* Line 1 */ '\n', 
0xc2,0xa1,0xc2,0xbf,0xc2,0xa2,0xc2,0xa3,0xe2,0x82,0xac,0xc2,0xa5,0xc2,0xa6,0xc2,
0xa7,0xc2,0xa8,0xc2,0xa9,0xc2,0xae,0xc2,0xaa,0xc2,0xab,0xc2,0xbb,0xc2,0xac,0xc2,
0xad,0xc2,0xaf,0xe2,0x99,0xaa,
/* Line 2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,0xa9,0xd0,0xaa,0xd0,0xab,0xd0,0xac,0xd0,0xad,0xd0,0xae,0xd0,0xaf,
/* Line 14 */ '\n', 
0xd1,0x81,0xd1,0x82,0xd1,0x83,0xd1,0x84,0xd1,0x85,0xd1,0x86,0xd1,0x87,0xd1,0x88,
0xd1,0x89,0xd1,0x8a,0xd1,0x8b,0xd1,0x8c,0xd1,0x8d,0xd1,0x8e,0xd1,0x8f,0
};

static gboolean
ascii_enter (GtkWidget * wid, GdkEventCrossing *event, GtkWidget *label)
{
	char buf[64];
	const char *text;
	gunichar u;

	text = gtk_button_get_label (GTK_BUTTON (wid));
	u = g_utf8_get_char (text);
	sprintf (buf, "%s U+%04X", text, u);
	gtk_label_set_text (GTK_LABEL (label), buf);

	return FALSE;
}

static void
ascii_click (GtkWidget * wid, gpointer userdata)
{
	int tmp_pos;
	const char *text;

	if (current_sess)
	{
		text = gtk_button_get_label (GTK_BUTTON (wid));
		wid = current_sess->gui->input_box;
		tmp_pos = SPELL_ENTRY_GET_POS (wid);
		SPELL_ENTRY_INSERT (wid, text, -1, &tmp_pos);
		SPELL_ENTRY_SET_POS (wid, tmp_pos);
	}
}

void
ascii_open (void)
{
	int i, len;
	const unsigned char *table_pos;
	char name[8];
	GtkWidget *frame, *label, *but, *hbox = NULL, *vbox, *win;

	win = mg_create_generic_tab ("charmap", _("Character Chart"), TRUE, TRUE,
										  NULL, NULL, 0, 0, &vbox, NULL);
	gtk_container_set_border_width (GTK_CONTAINER (win), 5);
	gtkutil_destroy_on_esc (win);

	label = gtk_label_new (NULL);

	table_pos = table;
	i = 0;
	while (table_pos[0] != 0)
	{
		if (table_pos[0] == '\n' || i == 0)
		{
			table_pos++;
			hbox = gtk_hbox_new (0, 0);
			gtk_container_add (GTK_CONTAINER (vbox), hbox);
			gtk_widget_show (hbox);
			i++;
			continue;
		}

		i++;
		len = g_utf8_skip[table_pos[0]];
		memcpy (name, table_pos, len);
		name[len] = 0;

		but = gtk_button_new_with_label (name);
		gtk_widget_set_size_request (but, 28, -1);
		g_signal_connect (G_OBJECT (but), "clicked",
								G_CALLBACK (ascii_click), NULL);
		g_signal_connect (G_OBJECT (but), "enter_notify_event",
								G_CALLBACK (ascii_enter), label);
		gtk_box_pack_start (GTK_BOX (hbox), but, 0, 0, 0);
		gtk_widget_show (but);

		table_pos += len;
	}

	frame = gtk_frame_new ("");
	gtk_container_add (GTK_CONTAINER (hbox), frame);
	gtk_container_add (GTK_CONTAINER (frame), label);
	gtk_widget_show (label);
	gtk_widget_show (frame);

	gtk_widget_show (win);
}