> For the complete documentation index, see [llms.txt](https://docs.mburger.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mburger.cloud/how-to/advance-section-retrieval/manage-locales-and-the-fallback-language.md).

# Manage locales and the fallback language

{% tabs %}
{% tab title="cURL" %}

```bash
curl https://mburger.cloud/api/blocks/<id>/sections?locale=en&force_locale_fallback=true
-H "Accept: application/json" 
-H "X-MBurger-Token: <token>" 
-H "X-MBurger-Version: 3"
```

{% endtab %}

{% tab title="iOS SDK" %}

```swift
// Set MBurger Locale
MBManager.shared.locale = Locale(identifier: "en_EN")
        
// Ask a section with the force locale fallback parameter
MBClient.getSection(withId: SECTION_ID,
                    parameters: [MBForceLocaleFallbackParameter()],
                    success: { section in
                                
                    },
                    failure: { error in
                                
                    })

```

{% endtab %}

{% tab title="Android SDK" %}

```kotlin
val arrayParameters = ArrayList<Any>()
arrayParameters.add(MBLocaleParameter(locale = YOUR_LOCALE))
//or if you want to force having fallback locale if sections are not completed
arrayParameters.add(MBForceLocaleFallback())

val sectionsListener = object: MBSectionsResultListener{
            override fun onSectionsApiError(error: String) {
            }

            override fun onSectionsApiResult(sections: ArrayList<MBSection>, 
                                             block_id: Long, 
                                             paginationInfos: MBPaginationInfo) {
            }
        }
        
MBurgerTasks.askForSections(context = applicationContext, 
                         block_id = BLOCK_ID,
                         filters = arrayParameters,
                         getElements = true,
                         listener = sectionsListener)
```

{% endtab %}

{% tab title="PHP SDK" %}

```php
// request with a specific locale
$response = (new MBurger())->locale($locale)->getProject();

//force the fallback
$response = (new MBurger())->forceLocaleFallback()->getBlock();
```

{% endtab %}

{% tab title="JS SDK" %}

```javascript
const mburger = require('mburger');

const instance = mburger.createClient({
    api_key: "12578sdfghjkl",
});

instance.getBlock({
    block_id: 884,
    locale: 'it',
    force_locale_fallback: true,
    original_media: false
}).then(result => console.log(result));


```

{% endtab %}

{% tab title="Flutter SDK" %}

```dart
// Set MBurger Locale
MBManager.shared.locale = 'en';

// Retrieve sections with the force locale fallback parameter
MBSection section = await MBManager.shared.getSection(
  sectionId: SECTION_ID,
  includeElements: true,
  parameters: [MBForceLocaleFallbackParameter()],
);
```

{% endtab %}
{% endtabs %}
