Localizing HTML files / Parallel file editing - localization

Due to timing constrains, I have developed a web application where a lot of language-specific strings have been directly hard-coded to large HTML/Javascript static files. Due to poor coding, code and content have not been properly separated.
To achieve quick and dirty localization, I am looking for some kind of text editor that would allow to "tag" the local elements of a file and turn them into "custom fields". These fields could then be stored in some resource file and translated independently from the shared structure, to generate multiple localized versions of the file.
I realize that I could do this myself through a "simple" templating mechanism, for instance by keeping a shared root file containing fields like {%welcome_message%} and a csv file for field translations, and then generate localized files.
But is there a text editor that could do this in a fast, user-friendly way ? For instance where we could see/modify the custom field values (as well as the root parts) directly when editing a file ?
What would be great for instance, would a a text editor feature/plugin allowing some kind of parallel file editing by distinguishing "root" and "localized" parts in a set of files.
(Note : currently I am using diff/merge tools to achieve this kind of results, but it will become increasingly cumbersome as we add more languages).

I think this could help you in parallel file editing http://www.sublimetext.com/.

Related

read write file properties with PropertyHandler Shell Extension

I'm trying to create PropertyHandler shell extension.
What's the best way for embedding properties like (Title,Author,.....) to use the same file in multi computers or devices?
StgCreateStorageEx ? way or there is other ways to do it?
because StgCreateStorageEx dealing with NTFS files only and i'm not sure if the file hold these properties with it if i open it in other device with same PropertyHandler
Is there any way to save properties inside the my file ?
The StgCreateStorageEx function creates a new storage object using the IStorage interface. This allows storing multiple data objects within a single binary file, see for example https://en.wikipedia.org/wiki/COM_Structured_Storage. So, technically, you can save almost anything in this file including embedded properties.
I don't think that this is limited to NTFS: The old Microsoft Office .doc format (and many other Microsoft products) use this storage format and work also with FAT32.
If you want to use this binary file format is a completely different question. As you did not provide any information about the content and format of your file, I cannot recommend anything. One alternative would be to store the content of your file in an xml file. Properties like Title and Author then could be added easily.

setup for multiple swagger API files

I am working on a project where we rewrite the interfacing of an existing application, porting everything to swagger/openAPI.
Right now, each feature has its own yml file right now, which is a standalone spec. But there are some drawbacks:
duplicated content in the yml files (e.g. models which could be shared accross files)
duplicated program code (which is generated from those yml files).
having to process each yml file individually when using tools.
Ideally we would like to have a seperate folder for each service, with the models and service description for that specific service close together, but separated from the other services. Of course there are also shared models, which we then want in a different folder (e.g. "/shared-models"). And finally we want all those files to be included by 1 main yml root file.
So, we have been looking at splitting/importing files with a $ref attribute. But it is tricky to come up with a full-scale file and folder structure, because the spec seems to allow usage of $ref on some places, but not all places. You can't just split and structure files any way you like. So, we will probably need some kind of trade-off.
I was especially wondering how other companies do this setup. (e.g. an example of a setup that uses an enterprise level structure of swagger files, would be excellent.) We like to keep things simple and whenever possible according to standards or popular conventions.
(For clarity: my question is not: "how to use $ref")

iOS App Localisation Best Practices And Placeholders

We're currently at the stage of looking at localising our app in to multiple languages now that the general concepts of the app have been decided. This is something I want to ensure is done correct from the start to lower the risk of headaches in the future.
The app targets iOS 7 and above, uses storyboards, and is written in Swift.
Storyboards
When working with a storyboard (or a xib), what's the best way to mark a UI element as "not to be translated"? For example, I have a placeholder string for a user's display name (Display Name), which will be replaced by a users display name at run time. This display name will not be localised, but neither should the string "Display Name". Is there a method of not having a UI element's value automatically put in to the strings file? If not, is going in to that file and manually removing strings I don't want localising a sustainable option?
Strings In Code
I'm using the Swift function NSLocalizedString with the key and comment parameters. Some places I've seen say to set the key to be a unique id based on the context (e.g., intro.login-button-text), while others seem to just put the full string in the default language (e.g., Login). I like the idea of the unique ids for the key, but would this not go against the idea of the "base" language?
Exporting
Xcode 6's "Export For Localization" option seems very useful for getting the correct format of file to be sent to translators. However, as mentioned previously, placeholder text does not need to be translated. Should these placeholders be removed from the exported xliff or the strings file prior to export?
Looking for the the same questions myself. Hope this will help you and others. Also I would recommend to have some kind of tool to organize the xliff/string files
Storyboards:
I've seen developers putting non translating texts in storyboard with extra parentheses. i.e. {Display name}.
By using this you can see by the translation itself if it needs to be translated or not. We use oneskyapp.com and can select to hide those translations and they will be hidden for each import of that key.
Strings in Code
By following this thread they suggest to use keywords.
Best practice for key values in translation files
Exporting
I cannot find a way to have some translations automatically removed when exporting. Off course you can put the views which has dynamic fields in different XIB/storyboards and decide not to translate those.
Again a tool like onskyapp.com can help you with this.
Formats
As of context with the field is important and a translation can be different when it is followed by i.e. a users name I would go for "%1$# is online!"

How to localize ActiveReport 7.0 XML PageReports rdlx

We have a huge number of Page Reports created using ActiveReport (*.rdlx files)
We use them from our ASP.NET MVC web appolication.
All captions and other stuff were initially created on English
Now we need to add a multilanguage support there so, somehow we need all existing texts be inserted in resource file and so we can then add translations
Is there a way to achive this task quickly, without going to each report field and manually extracting it into resource file?
Documentation says that once you change Language property, resource files will be created, but seems it is not working for XML reports, or there shouldbe a trick
For the reports designed with Code-behind, resource files are created pretty much the same as if you will create a Windows form... but I fail to find out how to do this for XML reports.
Page Reports support a localization; however it doesn't do so with a resource file.
This is mentioned off-hand in a single sentence on the page about Localization with ActiveReports 7.
Setting up a localized value in a Page Report is done the same was as you do in a Section Report. Simply change the report's Language property and then set new textbox values. At report runtime the appropriate value for the textbox will get used.
As I mentioned above, this doesn't generate a separate .resx file; instead if you inspect the resulting .rdlx you'll find a custom dd:LocalizationResources element is created that specifies the language setting and the new values for report elements.
The Localize property you are referring to in the documentation and in the code-behind reports are for the code-based "Section Layout" Reports but won't work for XML-based "Page Layout" reports (if you look at the generated code for the report, you'll see that the designer is just generating a bunch of code to localize the report).
Since code-behind reports support custom code or you can add references to another DLL you can write a simple function to localize captions. There is a good example of localizing this for .rdl reports here, you can use exactly the same approach with the ActiveReports' .rdlx files.
During that initial configuration of the report to be localizable you'll either have to manually change each static string to a Code.LocalizedValue call or maybe you could write a simple script to find each //Textbox/Value elements and replace it with a similar call. A simple script with a combination of xpath and regex could do help you automate the initial configuration of the report. To localize something other than a Textbox Value in the report (e.g. report parameter, labels/bookmarks), you'll need to replace the text of a different element than the Textbox Value but the concept is the same.
Of course, I am assuming you are localizing the static strings in your report. If you want to localize the values from the database then you'll have to do that differently (comment if you need help and I'll explain).

Customizable / Dynamic SWF generation

Wondered if anybody knows how customizable Flash swf files are made, where there appears to be a template swf that the user can then input some changes (eg text or image) and receives a newly-compiled swf file with their changes.
Some examples:
- http://flashfreezer.com/landingconfetti/index.html
Constraints:
- user receives a single output swf file that can be played with all their changes included. ie there is no reading from an xml file, or using Flashvars.
Been trying different things for a few weeks with no luck!
There are a number of ways, but generally the most common is to either use a SWF generating library (like PHP's) or through server-side compiling.
Normally, this will be a custom or proprietary library which uses the same language that the serve is running (and there are open-source libraries for this in PHP, Perl, Python, Java, C++... etc). The SWF is generated and served up with the appropriate headers so that the browser knows how to re-direct it. Often this will involve a pre-defined template which is then modified slightly for the new input. Only occasionally does this involve the manipulation of pre-generated SWF directly.
The other option is to have a command line call to the Flash IDE or the Flex compiler (and, technically, this can work for CS3 and CS4, though in a very nasty and hackish way) to generate a new version of the SWF on the fly. This is often slower, but it will generally yield a more finished feel to a product.
You could try Swiffotron. It can modify SWF files and do text replace type things on both text elements and in compiled actionscript.
Here's a swiffotron xml job file that does some text replacing.
And here's a swiffotron XML job file that modifies instances on the stage.
I didn't check the site, but the only way I can think of is to read the requirement details through flash (this can be done through plain html also) and then generate the AS files from their templates and compile them at the server side (using mxmlc or other compilers) and give back the SWF.
I get the impression that you're looking for SwfMill. SwfMill creates a swf based on an XML file that you create/define. You could use SwfMill on the server to generate a swf based on user input.

Resources