Skip to content

Commit cf77930

Browse files
authored
Grammar and typos
1 parent 8e1434a commit cf77930

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

14/umbraco-cms/tutorials/multilanguage-setup.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,11 @@ German Version:
263263

264264
<figure><img src="../../../10/umbraco-cms/tutorials/images/final-result-da.png" alt=""><figcaption></figcaption></figure>
265265

266+
## Using Multiple languages across APIs
266267

267-
## Using Muli languages across APIs
268+
When requesting content over an API, the culture will fall back to the default, unless explicitly set.
268269

269-
When requesting content over an API, the culture will fallback to the default, unless explicitly set.
270-
271-
To do this, we can use the IVariationContextAccessor.
270+
To do this, you can use the IVariationContextAccessor.
272271

273272
```csharp
274273
public class ExampleController : SurfaceController
@@ -301,30 +300,30 @@ public class ExampleController : SurfaceController
301300
}
302301
```
303302

304-
##Creating a Language Switching Navigation
303+
### Creating a Language Switching Navigation
305304

306-
To navigate between languages, we need to do two key things:
305+
To navigate between languages, you need to do two key things:
307306

308307
1. Get all the languages that the site can provide
309308
2. Identify the language used on the current page
310309

311-
Once we have these, we need to loop through the languages, and provide links to each home node.
310+
Once you have these, you need to loop through the languages and provide links to each home node.
312311

313-
#Getting all the languages for a site
312+
### Getting all the languages for a site
314313

315-
There are three ways to achive this. The best one is to use ```languageService.GetAllAsync();``` which retrives items from the cache.
314+
There are three ways to achieve this. The best one is to use `languageService.GetAllAsync();` which retrieves items from the cache.
316315

317-
Another is to use ```localizationService.GetAllLanguages();``` to call the database, which is expensive and ideally includes caching. This should only be done if you cannot use the ILanguage service. This service is marked as obsolete.
316+
Another is to use `localizationService.GetAllLanguages();` to call the database, which is expensive and ideally includes caching. This should only be done if you cannot use the ILanguage service. This service is marked as obsolete.
318317

319-
The alternative is to get the Home node, and find all of the cultures associated to it. This has a few benifits including speed and providing us with a link to show the user. It is the process we will use.
318+
The alternative is to get the Home node and find all of the cultures associated with it. This has a few benefits including speed and providing us with a link to show the user. It is the process you will use when following this guide.
320319

321-
#Identify the language for the current page
320+
### Identify the language for the current page
322321

323-
This is achived in ```cs.html``` files using ```umbracoHelper.AssignedContentItem.GetCultureFromDomains();```
322+
This is achieved in `cs.html` files using `umbracoHelper.AssignedContentItem.GetCultureFromDomains();`
324323

325-
#Steps
324+
#### Steps
326325

327-
Now we have what we need, create a view called ```Navigation.cshtml``` , and paste in the following:
326+
Now that you have what you need, create a view called `Navigation.cshtml`, and paste in the following:
328327

329328
```cshtml
330329
@using Umbraco.Cms.Web.Common
@@ -344,7 +343,7 @@ Now we have what we need, create a view called ```Navigation.cshtml``` , and pas
344343
{
345344
//get the settings for this culture
346345
System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo(cult.Key);
347-
//if the current page has a langauage variant, otherwise link to the homepage language variant
346+
//if the current page has a language variant, otherwise link to the homepage language variant
348347
string langUrl = umbracoHelper.AssignedContentItem.Url(cult.Key, UrlMode.Relative) ?? homePage.Url(cult.Key, UrlMode.Relative);
349348
350349
<li>
@@ -362,7 +361,8 @@ Now we have what we need, create a view called ```Navigation.cshtml``` , and pas
362361
}
363362
```
364363

365-
You will need to replace ```{{homeNodeContentAlias}}``` with the Document Type alias of your Home node.
364+
You need to replace `{{homeNodeContentAlias}}` with the Document Type alias of your Home node.
365+
366+
This will look at all the cultures available on the home node, and render links to either the language variant of the current page or the home node for the language variant. If the home node for a language variant is removed, it will not appear in the list.
366367

367-
This will look at all the cultures available on the home node, and render links to either the language variant of the current page, or the home node for the language variant. If the home node for a language variant is removed, it will not appear in the list.
368-
Additionally, ```System.Globalization.CultureInfo``` is used to obtain the native name of the language being rendered. This is useful if a user does not speak the default language of the site.
368+
Additionally, `System.Globalization.CultureInfo` is used to obtain the native name of the language being rendered. This is useful if a user does not speak the default language.

0 commit comments

Comments
 (0)