I've noticed that by default to string values are already in the AppResources.resx file within a Windows Phone 8 project, and they are ResourceLanguage and ResourceFlowDirection which are preset to en-US and LeftToRight respectively (my app is made in the default en-US culture). My question is, is it required to have these two strings in each resx file for each translated language with their respective ResourceLanguage and ResourceFlowDirection as well, or is it sufficient to have it only in the default resx file? To note, I am currently only translating into another LeftToRight language, but I may do a RightToLeft language in the future. What are the requirements for each?
For each added culture in the project properties, default resx string values will be added for each culture specifically within its resx file. Reference http://blogs.windows.com/windows_phone/b/wpdev/archive/2013/02/01/tips-for-localizing-windows-phone-8-xaml-apps-part1.aspx for information
It states:
Adding a Supported Culture from the Project Properties in Visual Studio will cause a new resource file with locale-specific name and app language initialization parameters in place to be created.
Related
I have to create a file format which holds some data, and it is to be opened by a particular application (college project).I have an empty grid. When a file is opened, it should contain the number of cells to be displayed on the grid, and in what shape, and other details. After that it should load specific numbers into some specific cells, which will also be present in the file. How do I create a file format for this? Or is it better to just not to create a special file format and rather move on with existing ones?
A file format is nothing but a previously agreed data structure. You can use any data structure, including plain text, as a data format.
You typically want your format to handle future extensions, so extensible formats such as JSON, YAML, or XML would be ideal. You can also use existing libraries to read and write in those formats.
If you allow users to add binary media into your file format (such adding images in a Microsoft Word document), you need to bundle your configuration (e.g., a JSON file), media (e.g., JPGs, PNGs, MOV, etc.), and other external sources (e.g., scripts) in a folder structure, and compress them (e.g., zip, gz, tar). Most modern file formats, including Microsoft Word Docx, are essentially zip files.
You may want to use a file extension. It is not mandatory but customary (typically 3 letters) and has usability benefits (e.g., icons and default applications).
If your custom file format is only a JSON file, simply using .json extension would be your best choice.
It's ill-advised to use a reuse an established file extension for a new file format. Here's a good list of filename extensions that you don't want to use: https://en.wikipedia.org/wiki/List_of_filename_extensions
Consider versioning your file format by adding a version attribute to your configuration.
When I bind a TextBlock.Text to LocalizedResources.ApplicationTitle, at design time it displays 'MY APPLICATION'. I searched through the code and couldn't find where this string literal is defined, or generally, how do I define design time value for localized strings?
Localized string resources is saved in AppResources.resx. And it is used in design time as well as in run time.
You can edit the .resx file in VS to add localized string values :
Practical reason for separating the resources in .resx file is, you can add string resources for other locale by simply adding another .resx file with corresponding culture info code suffix.
Further reference : How to build a localized app for Windows Phone 8
I'm using PhpStorm (and love it!), but the coding standard for my current project uses 4 space indents for .php files and 2 space indents for template files (.phtml). The template files are traditional php and HTML. Our code implements a standard Zend Framwork MVC setup.
Is there a way to configure PhpStorm to use one set of code style settings for *.php files and a different set of code style settings for *.phtml files?
Setting::File Type didn't work
I've tried associating .phtml files with the HTML file type, but that causes me to lose ALL php language assistance (no PHP syntax highlighting, no code assist, etc.).
Settings::Template Data Languages didn't work
I also looked for a solution using the the Template Data Languages setting. I setup my .phtml files to the File Type HTML, but PHP isn't an available setting, so it appears there is no way to add php language support for HTML files.
AFAIK it is not possible.
If you want to have PHP support, file extension has to be associated with PHP file type. That's the only way to have PHP support as PHP is not injectable language in current PhpStorm version/implementation.
You may utilize TextMate bundles support plugin and install PHP supported highlighting there. This will allow to assign .phtml extension to another file type. The drawback is that you can only have one language highlighting .. so HTML will not be highlighted + no code completion for actual PHP (that's as far as my simple experiments went with other not-yet-supported languages).
The gedit external tools plugin allows tools to apply to only one or more of a predefined list of file types.
How do I define my own file types?
Could you be more specific? What language?
Do yo want to add support for another programming language in gtksourceview - maybe you want to add code snippets for this language?
If this language is already supported
Then you have to find the language description and mime type files and install them on your system. You'll find these embedded in plugins packages (example: Gmate).
Here's an example for YAML:
find the language description file (yml.lang) and copy it to your ~/.local/share/gtksourceview-2.0/language-specs/ directory
find the mime-type file (x-yaml.xml) and copy it to your ~/.local/share/mime/package/
restart gedit; this language should show up the language list; you can now add your own snippets!
If you can't find any resource for this language (is this a custom language?)
Well, you'll have to write the whole thing. The mime-type file is pretty basic (just mapping file extensions to your newly created mime-type).
But writing your own language file is not straightforward.
These links should be useful to that matter:
Gedit: writing your own language
gtksourceview: new language tutorial (with C)
gtksourceview: XML language file reference
Using VS2005/2008 as a resource editor, one of the options in the Add Resource dialog is HTML: it appears to allow me to embed HTML file(s) into a resource (res) file. Does anyone know how to grab the HTML (as a string) from VB6 code? The LoadResData appears to be close to what I'm looking for but the problem is there isn't a HTML format defined in the table of formats (in that documentation link).
In Win32 C headers a resource format constant is defined called RT_HTML, it has the value 23. It should be possible to load the HTML resource type. Additionally you can verify the resource type number by looking at the built exe file with Resource Hacker. It lists the resource format types and resource IDs embedded in the file.
here is a good tutorial in c++ http://www.rohitab.com/discuss/index.php?showtopic=15281
you can probably adapt the code(usually function names are the same for win32 routines search on msdn.microsoft.com for documentation) or search the website for a VB example