<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#! /usr/bin/perl -w

use strict;

my $file = 'context-menu.js';
my $outfile = $file.'-i18n';
my $langfile = 'en.js';

open FILE, "&lt;$file";
#open OUTFILE, "&gt;$outfile";
#open LANGFILE, "&gt;$langfile";
my %texts = ();
while (&lt;FILE&gt;) {
    if (/"(.*?)"/) {
        my $inline = $_;
        chomp $inline;
        my $key = $1;
        my $val = $1;
        print "Key: [$key]: ";
        my $line = &lt;STDIN&gt;;
        if (defined $line) {
            chomp $line;
            if ($line =~ /(\S+)/) {
                $key = $1;
                print "-- using $key\n";
            }
            $texts{$val} = $key;
        } else {
            print " -- skipped...\n";
        }
    }
}
#close LANGFILE;
#close OUTFILE;
close FILE;

print "\n\n\n";
print '"', join("\"\n\"", sort keys %texts), '"', "\n";
</pre></body></html>