Multi Language Pages - c#

In My Project, there are different web pages and My requirement is when a User logs on based on user's language,page has to be displayed in user language.
I have googled it,but does not get proper solution.
I have got Satellite Asssemblies as a solution,but how to implement it?

MSDN documentation of ASP.NET localization is good place to start reading about it. Basic steps are as follows:
Localize your web pages - these would create language specific resources that will yield satellite assemblies for supported languages.
Localize other aspects within application e.g. date/time formatting and input, images, user messages etc
Set the culture and UI culture within your web pages as per needs (e.g. based on browser settings or user preference or user selection etc.). See this for how to do it.
See this walk-through that would quickly walks through basic steps.

Related

Using Aurelia with internationalization

I want my Aurelia app to support multiple languages. For example, when a user navigates to www.mysite.com/sv/start, I want them to view the site in Swedish. What is the best approach for solving this problem in Aurelia?
There is an Aurelia plugin for handling internationalization. Here are some helpful links:
GitHub page
Getting started
Aurelia localization
Using multiple translation files in aurelia-i18n
i18n update announcement
Since we share translations (web portal based on Aurelia and various mobile applications) we use this approach:
Translations are in database;
In Aurelia project we have LanguageService class responsible for loading translations from database and taking care about current language and related, language specific, culture information;
LanguageService is instantiated on the login page and then injected among components via #autoinject from aurelia-framework;
Each component or page has its own binded labels and properties translated from LanguageService;
This approach can be applied in your case because you can parse language id from given route.

User Session using different languages and MVVM

I am writing a desktop application using MVVM and Prism and I have the following problem. As well as the labels etc it is also necessary to store data in different languages.
For example, in the USA a user might be able to login using either English or Spanish (as they are a native speaker).
If the user logs in using Spanish when they go into a product details
form the product description will be saved to the database against
the Spanish language.
If they log in using English the product description will be saved to
the database and related to the English language.
At the moment my only ideas is as below:-
- a globally accessible ApplicationViewModel that contains a
CurrentLoggedInUser property
What I would like to know is how I go about saving the currently logged in user's chosen language when using MVVM, particularly in a desktop application?
N.B the chosen language can be different to the language and locale that the operating system is in
How do other people go about resolving this and maintaining the user's "session" across different windows / user controls when using MVVM?
All you need to do is store the current language somewhere, maybe as an LCID.
Generally this is used to load a language specific resource file, which takes care of most language dependant situations. Controls etc just store all their strings in resources, so they don't need direct access to the current language.
For situations where you do need access to the language, such as knowing where to save your database string, then yes, the language should be exposed either as some static/singleton, or more desirably, should be injected into whatever ViewModels need it.

Yet another .net custom cms

I'm trying to switch my custom cms written in php into .net c#. I was thinking to use cms as a learning project. I'm going to use C#, NHibernate ORM layer, mssql, mvc3 and jquery.
I'm aware there are plenty of commercials or open source cms, but still I'm going to spend some of my free time trying to learn new technology working on project like this.
So, is there anyone out there who is willing to share some ideas on creating cms domain model, usefull link, ideas, etc.
Thanks
A really basic CMS consist of 3 elements:
one database table to hold your "pages". The table structure is "name" and "content"
a route to transform requests of type /cms/pagename to a fixed controller, the method called cms and pagename as a parameter
a embeddable html editor
Now, there are two ways your "page" can be invoked. It is either create mode or view/edit mode.
In "create" mode, the page is requested but it is not in the database yet (e.g. cms/announcement1). In this mode you create a view consisting of a html editor and upon submit, you persist the page to the database.
In "view" mode, the page is requested and is IS in the database. You perform any necessary rewriting (for example you rewrite internal links of the form [cms/pagename] to a fully routable http address) and render the content.
If the user is authorized to edit the page, you also show a "edit" button which then invokes the html editor with the page loaded and ready to be edited.
And that's it.
There are tons of additional elements (caching, different built-in page types, embedding images, youtubes, preformatted texts) etc. but all of them are optional and you can introduce new features when you have the core already implemented.
Once I wrote a simple CMS following the structure above, it was a part of a bigger solution and till now it's been sucesfully deployed several hundred times. An advantage of a custom CMS is that it can be really simple and easily maintanable.

Architectural guidance for an eBay-like "Contact Us" system with a decision "workflow"

I am creating a new support center and "self-help" customer service module for an application. The CIO really likes the flow of eBay's "Contact Us" pages, that basically work like this:
First, you select a specific topic from a group of topics (e.g. Buying, Selling, Account on eBay)
You're then presented with what appears to be one of three variable types of information, based on the topic you picked (names are just what I'm calling them in some preliminary sketches):
"Descriptive": displays rich text with possible links to other parts of the application.
"Choice": Displays a list of additional topics
"Action": Lets the user look up an item and do some action (e.g. cancel)
From some experimentation, a choice can list to other choices, or to a descriptive block of text, or to an action section.
I'm turning up blanks as to the proper architecture for this. My platform of choice is ASP.NET (WebForms, sadly; we have no desire to touch MVC here) so the "Action" areas would have to be a user control that's dynamically loaded into a placeholder, but I'm more concerned with a possible database structure for this. I would need a way to know if each topic leads to one of the three types above and then on the page dynamically load either the content, list of links, or user control which makes things a bit trickier, nevermind the fact that a non-technical user will have to update and add the information from some kind of administrative panel.
Any suggestions for doing something like this? I'm not on a tight deadline, but I can't take too long or I'll be considered to be wasting time and not producing results.
If you can store the "tree of knowledge" in some way, like a custom XML file which would organize all options / possible actions, descriptions etc. Then you can "walk" it based on user's selections and display appropriate user control with content generated on the fly based on the contents of the XML node you're currently at.
Your "admin tool" would then need to update/modify the XML file, and your "public" CMS would render user controls inside an ASPX form.
One of the projects I worked on used this methodology for intranet's user menu - effectively a knowledge base of hyperlinks / actions split in to categories so they can be drilled-down to. Each element can contain links to other elements - so you have a spider-web like navigatable chain / workflow.
Just make sure each element has a unique ID (trivial to implement) and you can always get at it through xpath.
By having users modify a "working copy" and keeping backups of the live XML file when changes are published you also get versioning / roll-back which would be difficult to do in a DB.
If I personally was doing this I would just roll some MVC3 controllers that handle the work flow steps as needed. That seems to be out for you however.
With webforms, I would most likely consider handling this using Windows Workflow Foundation (the learning curve is moderately steep on this). Here's a pretty good example on using WF Flexible Web UI Workflow application through ASP.NET MVC & Windows Workflow Foundation. It's built on MVC however you could easily replace the return Views() with return UserControls.
Following a model like this would defacto give you the MVC pattern. The controller dictating flow matches very well for a workflow scenario.
Edit: Since this even seems out of the question, at this point you're best option is just writing a controller class that will manage the flow manually (probably a bunch of state / if checks) and then redirect users or return the appropriate user control.

Assitance in cms design

I am an intermediate asp.net and C# programmer.
I decide to develop a cms that contain below features:
modules common data, store in one table(contents table)
modules do not contain any data, only container for displaying data
information displayed in modules retrieve according to applied filters on modules common data table(contents). filters like(SubjectCode, GroupCode, ContentType, ...)
modules common settings hold in separate tables(BaseModules and ContentModules)
all contents contain access level
feasibility to define skin for modules
feasibility to commenting and rating contents
hierarchical page definition
SEO and Url Rewriting
theme
I doubt to develop cms myself or use ready cms. Please help me.
I worked for a long time with microsoft portal starter kit.
Image address of database diagram is:
Blockquote
http://www.4freeimagehost.com/show.php?i=1d3239cad5a2.gif
Blockquote
There are plenty of good free CMS systems out there. I would suggest starting with Google.
A former employer spent over £200,000 on a system (against my recommendation) on a CMS which was essentially a custom Web User Interface over the top of a free CMS backend. The user interface was very slick, but this just goes to show that you should not try to re-invent the wheel.

Categories