Menu

#733 Capture variables in source filename to target mapping

2.5
closed-fixed
5
2012-04-20
2011-11-12
Anonymous
No

For translations, we not always use a file named like:

invantive_dnn.ascx.resx

but one with the current country and language in it, such as:

invantive_dnn.ascx.US-EN.resx

The name of the translated resx file will be fine for the first alternative (see feature request 3330974), but the second one generates a filename that still holds *.US-EN.*.

It woudl be great if one could specify a part of the name to be replaced. For instance, by specifying as source pattern:

*.${targetCountryCode}-${targetLanguageCode}.resx

instead of

*.resx

Combined with a preferred order in which to try to match the specified file filters.

Discussion

  • Guido Leenders

    Guido Leenders - 2011-11-12

    Sorry, forgot to log in. I am the submitter.

     
  • Guido Leenders

    Guido Leenders - 2011-12-11

    Solved by patch on 3346155.
    The patch includes generation of the target locale in Microsoft's preferred format.
    ${targetLocaleMicrosoft}

     
  • Didier Briel

    Didier Briel - 2012-04-11

    Implemented in /trunk.

    New variables ({1}, {2}, etc.) are available in the file filters to rename files. Each of the variable corresponds to what has been captured by jokers ('*' or '?').

    For instance, if your source file is bundle_en.properties, ${1}_${targetLanguage}.properties
    will give you
    bundle_fr.properties

    If you transform
    *_??.properties
    into
    ${1}_${targetLanguage}_from_${2}${3}.properties
    you will get
    bundle_fr_from_en.properties.

    Each '?' is captured separately into its own variable, in case you have filenames such as bundle_enfr and you want to capture just the 'en' part.

    Didier

     
  • Didier Briel

    Didier Briel - 2012-04-11
    • assigned_to: nobody --> t_cordonnier
    • summary: Source file name to target mapping --> Capture variables in source filename to target mapping
    • status: open --> open-fixed
     
  • Didier Briel

    Didier Briel - 2012-04-20

    Closing...
    This feature was implemented in the released version 2.5.3 of OmegaT.

     
  • Didier Briel

    Didier Briel - 2012-04-20
    • status: open-fixed --> closed-fixed
     
  • Didier Briel

    Didier Briel - 2012-05-09

    Some new variables have been added.

    They allow to use each "set of instances" of extensions.
    Assuming a source document named
    Document.xx.docx

    The following variables will give the following results:
    ${nameOnly-0} Document
    ${nameOnly-1} Document.xx
    ${nameOnly-2} Document.xx.docx
    ${extension-0} docx
    ${extension-1} xx.docx
    ${extension-2} Document.xx.docx

    Assuming the document has more extensions, it can go to ${nameOnly-3} ... ${nameOnly-n} and ${extension-3} ... ${extension-n} , where n will correspond to the full number of extensions, so that
    ${nameOnly-number of extensions} will be equal to ${nameOnly} and
    ${extension-number of extensions} will be equal to ${extension}

    The changes are implemented in SVN (2.5 and /trunk), and will be released in 2.5.4.

    Didier

     

Log in to post a comment.