<commit_before>#! /bin/false

# vim: tabstop=4
# $Id: gettext_pp.pm,v 1.14 2003/07/14 12:24:57 ingrid Exp $

# Pure Perl implementation of Uniforum message translation.
# Copyright (C) 2002-2003 <NAME> <<EMAIL>>,
# all rights reserved.

# Distribution either under the terms of the Artistic license (see
# Artistic) or - at your choice - under the terms and conditions of
# the GNU General Public License described below.

# 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, 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., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.

# Copyright (C) 2002-2003, <NAME> <<EMAIL>>
# All rights reserved.

package Locale::gettext_pp;

use strict;

require 5.004;

use vars qw ($__gettext_pp_default_dir 
	     $__gettext_pp_textdomain
	     $__gettext_pp_domain_bindings
	     $__gettext_pp_domain_codeset_bindings
	     $__gettext_pp_domains
	     $__gettext_pp_recoders
	     $__gettext_pp_unavailable_dirs
	     $__gettext_pp_domain_cache);

use locale;

BEGIN {
    $__gettext_pp_textdomain = 'messages';
    $__gettext_pp_domain_bindings = {};
    $__gettext_pp_domain_codeset_bindings = {};
    $__gettext_pp_domains = {};
    $__gettext_pp_recoders = {};
    $__gettext_pp_unavailable_dirs = {};
    $__gettext_pp_domain_cache = {};
    
    $__gettext_pp_default_dir = '';
    
    for my $dir (qw (/usr/share/locale /usr/local/share/locale)) {
	if (-d $dir) {
	    $__gettext_pp_default_dir = $dir;
	    last;
	}
    }
}

require POSIX;
require Exporter;
use IO::Handle;
require Locale::Recode;

BEGIN {

	my ($has_messages, $five_ok);
	
	my $has_messages = eval '&POSIX::LC_MESSAGES';

	unless (defined $has_messages && length $has_messages) {
		$five_ok = ! grep {my $x = eval "&POSIX::$_" || 0; $x eq '5';}
				qw (LC_CTYPE
				   LC_NUMERIC
				   LC_TIME
				   LC_COLLATE
				   LC_MONETARY
				   LC_ALL);
	    if ($five_ok) {
	    	$five_ok = POSIX::setlocale (5, '');
	    }
	}
	
	if (defined $has_messages && length $has_messages) {
eval <<'EOF';
sub LC_MESSAGES()
{
    local $!; # Do not clobber errno!
    
	return eval '&POSIX::LC_MESSAGES';
}
EOF
	} elsif ($five_ok) {
eval <<'EOF';
sub LC_MESSAGES()
{<commit_msg>syntax errors<commit_after>#! /bin/false

# vim: tabstop=4
# $Id: gettext_pp.pm,v 1.15 2003/07/14 14:20:51 ingrid Exp $

# Pure Perl implementation of Uniforum message translation.
# Copyright (C) 2002-2003 <NAME> <<EMAIL>>,
# all rights reserved.

# Distribution either under the terms of the Artistic license (see
# Artistic) or - at your choice - under the terms and conditions of
# the GNU General Public License described below.

# 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, 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., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.

# Copyright (C) 2002-2003, <NAME> <<EMAIL>>
# All rights reserved.

package Locale::gettext_pp;

use strict;

require 5.004;

use vars qw ($__gettext_pp_default_dir 
	     $__gettext_pp_textdomain
	     $__gettext_pp_domain_bindings
	     $__gettext_pp_domain_codeset_bindings
	     $__gettext_pp_domains
	     $__gettext_pp_recoders
	     $__gettext_pp_unavailable_dirs
	     $__gettext_pp_domain_cache);

use locale;

BEGIN {
    $__gettext_pp_textdomain = 'messages';
    $__gettext_pp_domain_bindings = {};
    $__gettext_pp_domain_codeset_bindings = {};
    $__gettext_pp_domains = {};
    $__gettext_pp_recoders = {};
    $__gettext_pp_unavailable_dirs = {};
    $__gettext_pp_domain_cache = {};
    
    $__gettext_pp_default_dir = '';
    
    for my $dir (qw (/usr/share/locale /usr/local/share/locale)) {
	if (-d $dir) {
	    $__gettext_pp_default_dir = $dir;
	    last;
	}
    }
}

BEGIN {
	require POSIX;
	require Exporter;
	use IO::Handle;
	require Locale::Recode;

	my ($has_messages, $five_ok);
	
	$has_messages = eval '&POSIX::LC_MESSAGES';

	unless (defined $has_messages && length $has_messages) {
		$five_ok = ! grep {my $x = eval "&POSIX::$_" || 0; $x eq '5';}
				qw (LC_CTYPE
				   LC_NUMERIC
				   LC_TIME
				   LC_COLLATE
				   LC_MONETARY
				   LC_ALL);
	    if ($five_ok) {
	    	$five_ok = POSIX::setlocale (5, '');
	    }
	}
	
	if (defined $has_messages && length $has_messages) {
eval <<'EOF';
sub LC_MESSAGES()
{
    local $!; # Do not clobber errno!
    
	return eval '&POSIX::LC_MESSAGES';
}
EOF
	} elsif ($five_ok) {
eval <<'EOF';
sub LC_MESSAGES()
{
{'fraction_non_alphanumeric': 0.10516605166051661, 'fraction_numerical': 0.020664206642066422, 'mean_word_length': 3.6572164948453607, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '322904', 'n_tokens_mistral': 2059, 'n_tokens_neox': 1835, 'n_words': 560}