<commit_before>#!/usr/bin/perl

@ARGV >= 1 || die "Usage: $0 <po directory> [<file pattern>]\n";

my $source  = shift @ARGV;
my $pattern = shift @ARGV || '*.po';

if( open F, "find $source -type f -name '$pattern' |" )
{
	while( chomp( my $file = readline F ) )
	{
		my ( $basename ) = $file =~ m{.+/([^/]+)\.po$};
		
		if( -f "$source/templates/$basename.pot" )
		{
			printf "Updating %-40s", $file;
			system("msgmerge", "-U", $file, "$source/templates/$basename.pot");
		}
	}

	close F;
}<commit_msg>build/i18n-update.pl: disable fuzzy maching for po updates, does not work well with our key format<commit_after>#!/usr/bin/perl

@ARGV >= 1 || die "Usage: $0 <po directory> [<file pattern>]\n";

my $source  = shift @ARGV;
my $pattern = shift @ARGV || '*.po';

if( open F, "find $source -type f -name '$pattern' |" )
{
	while( chomp( my $file = readline F ) )
	{
		my ( $basename ) = $file =~ m{.+/([^/]+)\.po$};
		
		if( -f "$source/templates/$basename.pot" )
		{
			printf "Updating %-40s", $file;
			system("msgmerge", "-U", "-N", $file, "$source/templates/$basename.pot");
		}
	}

	close F;
}
{'fraction_non_alphanumeric': 0.23202911737943585, 'fraction_numerical': 0.009099181073703366, 'mean_word_length': 3.296875, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1507317', 'n_tokens_mistral': 478, 'n_tokens_neox': 435, 'n_words': 117}