All pastes #383428 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-06 10:34 UTC
rendered paste body
<?php

//. setting up gettext.
$locale = "de_DE";
$domain = 'testing';

putenv("LANGUAGE=$locale");
putenv( "LANG=" . $locale); //required on windows, because setlocale doesn't really work
setlocale( LC_ALL, $locale);
bindtextdomain( $domain, dirname( __FILE__) . '\locale'); 
textdomain($domain); 

echo dirname( __FILE__) . '\locale';

$window = new GtkWindow();
$window->set_default_size( 300, 200);
$window->set_title( _('window title'));

$vbox   = new GtkVBox();
$label  = new GtkLabel( _('Translation test'));
$button = new GtkButton( gettext('Close window'));

$vbox->pack_start( $label);
$vbox->pack_start( $button);

$window->connect_simple('destroy', array('gtk', 'main_quit'));
$button->connect_simple( 'clicked', array( 'gtk', 'main_quit'));

$window->add( $vbox);
$window->show_all();
gtk::main();

?>