Localization - Placeholders and Pluralforms


  • Hi there,

    We are currently struggeling with the Javascript capabilities of Windows 8 for localization:

    How is it possible to do wildcard replacement in a resources-file, like you have for example the following resources.rejson


        "loading_images" : "Loading :numImages images"

    And then I want to do something like:

    WinJS.Resources.getString("loading_images", {numImages: 14}).value

    So basically, sprintf-functionality is what I'm looking for.

    And one more thing: How to handle plural forms in localization? (n)gettext has a nice implementation for such problems - how is that handled in Windows?


    /edit: I've already looked at the Application resources and localization sample project but could not find anything helpful to my questions there.
    Tuesday, August 14, 2012 9:27 AM


  • If I understand your question correctly, the sample you referenced does exactly what you want.  See scenario 8!

    Jeff Sanders (MSFT)

    Thursday, August 16, 2012 7:30 PM