How to setup monodoc to work with transifex.com? - c#

monodoc is the only C# system, which work on mono on linux. Sandcastle fails - https://github.com/ArsenShnurkov/sandcastle-tools/issues/1
The goal is to get multilanguage HTML documentation for API.
How to setup development with monodoc and transefix.com (which is opensource translation platform) for hello-world project?

Interesting question; The best course of action would be to extract the strings from the various XML nodes (those inside Docs/) and put them on a .po file, translate that, and then produce a translated version out of it.

Related

MFC / C#.NET mixed mode localization (multi language / multilingual application)

we have a complex application here which is written in MFC and C# and running in mixed-mode. We're now trying to set up a multi-lingual version of this application. So I created English resource files (in the .NET part) for every existing resource file and translated all necessary strings. E. g.: MyResource.resx and MyResource.en.resx. Original language is German.
Now if I start the solution containing only the .NET-Projects with the Thread.CurrentThread.CurrentUICulture set to 'en-US' all the dialogs and texts appear in English as expected. The MFC part (the compiled code in the .exe file) is translated with a tool called Lingobit which replaces the strings in that .exe file and it works fine. So far, so good.
But when it comes to start the full mixed-mode application all the English resource files of the .NET part are ignored and it falls back to the German ones.
I additionally tried to use Lingobit to translate the .NET-DLLs. Lingobit creates a separate mylib.resource.dll of my original mylib.dll which seems to be ignored, too.
I'm running out of ideas here how to create an English version of this application. Any suggestion how to make my mixed-mode application use the English resource files?
Thanks in advance.
The solution itself was quite simple, but it took me a while to find it. If you compile the .Net project Visual Studio creates a "en"-Folder in your output folder (e. g.: bin/Debug/). This folder is not created with the compilation of the mixed mode version, so just copy it from your .Net output folder to your mixed mode output folder.
In addition I'll create a little script to copy it to the needed location after the build.
Have a good one everybody.

Antlr4 C# targets and output path of generated files

I have a C# solution with an Antlr3 grammar file, and I'm trying to upgrade to Anltr4. It turns out the grammar was the easy part (it became better, and one third the size!). Generating the parser turned out to be the tricky part.
In the old solution I merely ran AntlrWorks to update the lexer and parser .cs files when the grammar file changed. The lexer and parser were included directly in the same project as the grammar so the framework around the parser could make use of them directly.
With the Antlr4 targets for C# I noticed that (at least by default) the output path of the generated Parser C# classes is in the intermediate directory, e.g. obj\Debug. This means I can't use the parser directly in the same project. Am I supposed to change the output path if I want the generated source usable in my sln? Don't I want it in my sln?
I tried making a separate project for the parser generation, that is, a project containing only the grammar file. When this project is built using the Antlr4 targets, the resulting assembly can be referenced from projects needing the parser classes. However, if this project is included in the solution I still don't get any intellisense in visual studio since it bases its intellisense on source files for loaded projects, so it is still not quite usable. The only way I could get it working properly was to build then unload the parser project, and have other projects reference it as an assembly file rather than a project.
EDIT:
After looking on the antlr-interest list I found this thread indicating that the problem with intellisense may be Resharpers fault. If this is the case, then my question is rather how to keep using both Antlr4 and Resharper in my solution?
https://groups.google.com/forum/#!topic/antlr-discussion/QSuJXphaBDg
I found an extension for Resharper: ReSharper.ExternalCode.
Tip for Antlr: add obj\Debug in Resharper -> Code Inspection -> External Code and reload solution.
It's works for me.
There is an easy way to get the best of both Antlr 4 and Visual Studio. You are on the right track in having a separate grammar project and implementation project, but you are missing a couple steps.
Follow these steps to get the Intellisense working
In Visual Studio, go to Tools -> Extensions and Updates and search the Online section for "ANTLR Language Support" by Sam Harwell.
This does a few things:
Adds Templates for the combined grammars.
Adds Syntax Highlighting
Adds an MSBuild target for the grammar to generate the parser.
In your solution, set up your project structure like this:
Solution
Grammar Project
ANTLR 4 Combined Grammar
Implementation Project
Folder for Links to Generated files
Listener Implementation Class
Write and Compile your grammar.
In your folder for the Links to Generated Files, Right-Click the folder and click Add -> Existing Item
Browse to Grammar Project\obj\Debug and select all the generated parser files.
This next step is important. On the Add button there is a little drop-down arrow. Click the drop-down arrow and click "Add As Link".
This will add the generated files to the implementation project using a symbolic link instead of a direct copy.
This gives the added benefit of not having to remove and re-add the parser files if you have to change your grammar later.
Intellisense should work now for your generated parser classes, and you don't
even have to disable ReSharper.
You are encountering a known bug with ReSharper. The ANTLR 3 and ANTLR 4 C# build integration is reliable, and uses long-established patterns that Microsoft uses with other languages and code generation tasks. Your options are:
Stop using ReSharper
Get the ReSharper authors to address the lack of support for this feature, or
Modify the ANTLR 4 target to work around the limitation in ReSharper, which will introduce other problems into the build which may or may not be acceptable for your use.
Option 1 is certainly the least expensive, and most likely to provide reliable long-term support for your projects.

referencing and importing third party python libraries

I am fairly new to python, and come from a C# background. In C# l, third party libraries are commonly stored inside the project folder.
This means that libraries are totally internal to the project. The project then is not dependent on anything outside of the project folder (other than .net framework of course).
I really like this structure and have tried successfully to mirror this in python by copying the libraries into a lib directory, in the project root, and adding the lib folder to the python path on startup of the application.
I am worried that there may be something I am overlooking by doing this as I have looked around a bit amd have not really seen anyone else in thw python community doing this.
My question is simply - is this ok? Is there something that I may miss by simply dumping the necessary .py libraries in, rather than using easy install, and thus storing the libraries in site packages, at a system level?
Please feel free to let me know of any drawbacks you can see, no matter how simple.
Thanks!
I'll espouse the usage of virtualenv and pip for development purposes. This will give you exactly the sandbox that you are used to. As for distribution, use setup.py and reuse the requirements.txt file that you would use with pip install -r to install dependencies to generate the install_requires argument to setuptools.setup. I've been meaning to set up an example that shows this off a little - check out https://github.com/dave-shawley/setup-example for a nice example with some description too. I plan on adding a little more to this as time allows.
If you want to closely manage the dependencies of your code on the per project basis you might want to take a look at virtualenv.
Virtualenv will allow you to keep your dependencies close to your source but will remove the error prone manual copying of the .py files.
On top of that remamber that some packages are not pure python and they sometimes contain compiled C code - if you use virtualenv you do not have to worry about it.

What tool would you choose for generating multiple C# files for WCF contract versioning?

I have some breaking changes to WCF contracts and I want to be able to support two versions of the contracts from within the same website.
somewhere.com.catalog.v1
class A
class B...
somewhere.com.catalog.v2
class A
class B
I would like to have a utility program to copy the files from v1, into v2 and change all the namespace references so I don't have to do a manual copy and find & replace.
T4 template - need to parameterize this. I found a custom templating project on codeplex.
PowerShell script. Found Aaron Lerch's blog which seems to be close to what I wanted, but I have the worst problems with PowerShell and got a compile error. I tried downloading some PowerShell extensions for Visual Studio 2010 to get auto-complete but ran into extension conflicts.
Razor template. From what I read it seems to be targeted to single file generation.
MSBuild task using the TextTransform utility.
Just create a command line C# program that takes in the input folder, output folder and new namespace.
Other _______
Just having trouble choosing the best tool for the job and wanting to learn something new that can be applied in other situations.

generate tag file from .net librarys(c#) using ctags

is there a way to generate a tag file from i.e system.dll ?
maybe some actionscript ones too like Display or Sprite.
The Zeus editor can generate ctags information from any C# assembly, so it is in fact possible, but it does take a little bit of effort.
Zeus does this by exporting the assembly interface to a psuedo C# file and it then runs ctags utility against this psuedo C# file.
C# itself has several APIs that allow you query the details of an assembly so it is not too difficult to write a C# tool that can export the interface of an assembly.
Download the program called Reflector for .NET.
How to use it :
launch it.
select your .NET version
File > Open, select your dll
In the node tree, right click on the function you want to see "Disassemble"
enjoy ;)
Then use ctags -R
c# is a supported language -- at least under 'exuberant ctags' -- but the nature of the tool is that it generates tags from source files. I don't think ctags can generate tags from .dll's in any language. Is the source for system.dll included with .net?
You may want to read more about what exactly ctags is and how it works:
Wikipedia entry for ctags
If you're looking for a way to write a script to do this, then you could use Telerik's JustDecompile (which is free and offers a command line interface), and then run ctags on the resulting directory.
An example from their website:
JustDecompile.exe [/lang:csharp] /out:[OutputDirectory] /target:[PathAndAssemblyName].

Categories

Resources