8

Is there any tool I can use to perform pseudolocalization on an ASP.NET MVC app (using the Razor view engine) in order to help localizability testing?

Charles
  • 50,943
  • 13
  • 104
  • 142
Clafou
  • 15,250
  • 7
  • 58
  • 89

3 Answers3

8

i wrote a small utility app that lets me convert text into "pseudo".

It's based on a simple function which looks at each character in the string. If the character IsAlpha then i add an accent to it.

i add an accent by appending the character with a random diacritic mark between U+0300 and U+036F (the diacritical marks range).

enter image description here

So now i just localize my application/web-site like i were one of the dutch speaking localizers.


ỉ w͝rͨo͡t̮e̤ a͈͟ s̏m͈a͞l̪lͅ u͇t̽i̡l̔i͜țy̭ a͟p̉p͕ t̼h̥aͤt̖͊ l͊e̗t̘s̈́ m̶eͭ c͟o̙n̚v̈e̲r̓t̝ t͌e̽x̳t͈ i̍n̔t̖o̺ "p̪̜s̔e̊u̟d̮o̱".

I͔t͒'sͪ b̞aͧs̜e̋dͫ o̸͚n͙ a̼ s̼i̥m̢ͫpͫl͗e̺ f̙uͪn͎̉c͙t͒ḯo̾n̑ w̰h̙i̷c͟ḣ̌ l̼óoͦk͔s͑ a̬t̆ e̓a̔c̈hͭ c̚h̻a̿r̴aͭc̤t̙eͦŗ͉ i̞n̴ t̀h̸e̮ͫ s̖t͘r͕i͇n͒g̴͐. I̳fͣ t̰ĥe̿ c͋h͡a͖r̸a̸c̟t̼e̞rͪ Ìs̀A̒l͒p̷h̗a̲ ţh̽e͚nͥ i̡ a̰d͙d̬ a̅n̊ a̐c̒c̒e̤͞n̜t̽ t̆o͑ i̴tͪ.

i̋ a̸d̋d́ a̰n̏ a͛c͏c̣͗e̾n͡t̎ b̷̞ẏ a̐p͞p̧͔eͩn͊ḍ͋ín̓g͚ t̬h͚ẹ ćh̞a͗ŗa͖c͐t̊e̷rͅ w͙iͩt̮hͮ a͡ r͙a͋nͅd̃o͞m̚ dͬi̠a͚c̸r̾iͩt͖i͋c̭ m̓ḁr̵k̡ b̞ë́t̼w̓e̬ë́n̨ U̵+0300 a̢n͙d͜ U͕+036F͓ (t̯͉hͪ͟eͮ d͓i͉aͣc͕̬r͜i͒t́i͓c̯a͚l̼ m̓a̅r̝̜k͎s̯ r͋ăn̪̒g̟e̱̮).


There's also an option to add padding to text, so allow for other languages not using the same amount of space as english

  • Today -> [T̀oͨd̼a͈̹y̭ !!]
  • Control Panel -> [C̊ȍńt̪r͗o͂l͇ P̈ȁñeͮl͢ !!!!!]
  • Oxydative Decarboxilation -> [Ŏx͞y̠dͥa͂t̿i̚v͙eͪ D̼e̖c̿aͤr͖b̐o̼x̹i͂l͖a̠t̮i̓o̧n̰ !!!!!!!!!]

And my PsuedoLocalizeText function:

function TForm1.PsuedoLocalizeText(s: WideString; AddPadding: Boolean): WideString;
var
    i: Integer;
    sb: TWideStringBuilder;
    x: Integer;
    tiny: WideString;
const
    n: WideString = ''; //n=nothing
begin
    //Code is public domain. No attribution required.
    sb := TWideStringBuilder.Create;
    try
        for i := 1 to Length(s) do
        begin
            //http://www.fileformat.info/info/unicode/block/combining_diacritical_marks/list.htm
            //U+0300 .. U+36F are combining diacritic marks
            x := $300+Random($36f-$300);

            if Windows.IsCharAlphaW(s[i]) then
            begin
                tiny := n+ s[i] + WideChar(x);
                if Random(10) < 1 then
                    tiny := n+tiny+WideChar($300+Random($36f-$300));
                sb.Append(tiny);
            end
            else
                sb.Append(s[i]);
        end;

        Result := sb.ToString;

    finally
        sb.Free;
    end;

    if AddPadding then
    begin
        Result := '['+Result+' ';

        for i := 1 to Ceil(Length(s) / 3) do
        begin
            Result := n+Result+'!';
        end;
        Result := Result+']';
    end;
end;

Update My psuedolocalizer:

enter image description here

My next task is to have it work on *.resx, but exclude *.xx-yy.resx, so it can work on WinForms applications as well.

And of course fill in Size, Attributes, get the right icon for Folders.

Then maybe have it highlight the fr-FR or qps-ploc part of filenames.

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
  • Looks great! Is it public? I'm really looking for a tool I can run on .resx files (or perhaps on satellite assemblies) to produce pseudolocalized versions. – Clafou Oct 06 '11 at 12:18
  • You can take the code and translate it into whatever language you like. There's probably even web-sites that can do the same thing (leet-ify your name or something) – Ian Boyd Oct 06 '11 at 12:34
  • I'm hoping there is a tool out there that can do all the work in pseudo-localizing the app. This will be run on multiple resx files (or satellite assemblies) multiple times through the development process so it needs to be easy to integrate into the development process. Something that can be dropped into the continuous integration build build process would be ideal! Unfortunately I have a feeling I am expecting too much! :) – Clafou Oct 06 '11 at 13:06
  • Resx files are simple XML files. It wouldn't be *too* difficult to look for any file named `*.aspx.resx`, copy it to `*.aspx.qps-ploc.resx` (overwriting any existing version). Then iterate the XML, replacing all text with `PseudoLocalizeText()` version. – Ian Boyd Oct 06 '11 at 13:46
  • This afternoon i wrote a small app that takes `*.aspx.resx` files in a specified folder, loads the XML, pseudolocalizes the text, and saves them back out as `*.aspx.qps-ploc.resx`. Not that hard to do. – Ian Boyd Oct 06 '11 at 21:19
  • Nice! Are you considering making it public or open source? – Clafou Oct 07 '11 at 19:55
  • Since there is no answer suggesting a publicly available tool, accepting this as the best answer. – Clafou Oct 11 '11 at 21:36
2

There is a "pseudoizer" tool in the downloads for this article: http://msdn.microsoft.com/en-us/magazine/cc163991.aspx

It includes both source (winforms) and binary if you're lazy

Robert Levy
  • 28,747
  • 6
  • 62
  • 94
1

After not finding anything quick, free and easy, I built Pseudolocalize.com! Just copy/paste/click and you've got the pseudolocalized version of your strings!

JerSchneid
  • 5,817
  • 4
  • 34
  • 37