PHPackages                             taitava/silverstripe-untranslatablefields - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. taitava/silverstripe-untranslatablefields

AbandonedSilverstripe-module[Localization &amp; i18n](/categories/localization)

taitava/silverstripe-untranslatablefields
=========================================

Make custom specified data fields to share the same value across different locale/language versions.

21762[1 issues](https://github.com/Taitava/silverstripe-untranslatablefields/issues)[1 PRs](https://github.com/Taitava/silverstripe-untranslatablefields/pulls)PHP

Since Jan 19Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Taitava/silverstripe-untranslatablefields)[ Packagist](https://packagist.org/packages/taitava/silverstripe-untranslatablefields)[ RSS](/packages/taitava-silverstripe-untranslatablefields/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Untranslatable Fields
=====================

[](#untranslatable-fields)

Maintainer
----------

[](#maintainer)

Jarkko Linnanvirta (Nickname: Taitava) posti (at) taitavasti.fi

Introduction
------------

[](#introduction)

This module makes it possible to define fields that cannot be translated to different languages when using the Translatable module. For example, you may have a model called Person with two fields: name and description. You have installed the Translatable module in order to be able to provide the description field in different languages. But since a person's name is not (usually) translated, there is no reason to have to enter the person's name multiple times - once per every translation.

In practice, every time an object (that extends this module) gets saved to the database, its translations are iterated over and the values of fields marked as untranslatable are copied over to the other translations and saved.

- Make edits to whatever language version - edits to untranslatable fields are applied to all translations
- Only the writing process is modified
- Same values in untranslatable fields in the database across different translations
- Not dependent on the CMS module (I believe - have not tested :) )
- Untranslatable fields can have special CSS styles and HTML attributes in the backend (by default there are no style/ attribute changes)

Requirements
------------

[](#requirements)

- SilverStripe 3.1
- Translatable

The CMS module is not necessarily needed.

Installation
------------

[](#installation)

This is a very simple one to configure. But first, either download this module and unpack it to a folder named "untranslatablefields" under your site's root directory, or install via Composer:

```
composer require "taitava/silverstripe-untranslatablefields:*"
```

Then create a new file: mysite/\_config/untranslatablefields.yml and put the following content there:

```
---
UntranslatableFields:
  fields:
    MyClass:
      - MyField
      - CommonField
    AnotherClass
      - AnotherField
      - CommonField
```

Also, remember to extend your classes with this module. Edit mysite/\_config/config.yml and add the following lines:

```
MyClass:
  extensions:
    - UntranslatableFieldsExtension

AnotherClass:
  extensions:
    - UntranslatableFieldsExtension
```

These two configurations together render fields MyField and CommonField in MyClass and fields AnotherField and CommonField untranslatable. Note that specifying the classes does not affect any child classes!

**You can also do the opposite**: Untranslate all but the specified fields! Just add `invert: true` to mysite/\_config/untranslatablefields.yml:

```
---
UntranslatableFields:
  fields:
    MyClass:
      - MyField
      - CommonField
    AnotherClass
      - AnotherField
      - CommonField
  invert: true
```

Auto Publish
------------

[](#auto-publish)

If the user saves and publishes for example a Page object, its different language versions will get saved, but not published by default. This is because the DataObject::write() method does not publish changes by default. UntranslatableFields can be set to do the publishing for DataObjects that has the Versioned extension.

This feature is off by default. To turn it on, add the following to mysite/\_config/untranslatablefields.yml:

```
UnstranslatableFields:
  auto_publish: true
```

Note: if the translation was in the Stage mode (= not published) before the write operation, it won't get published automatically even if this option is set to true. If there were an oldder published version, the changes are written to the newest (Staged) version and will not get published.

Indicate the untranslatable status of fields in the CMS
-------------------------------------------------------

[](#indicate-the-untranslatable-status-of-fields-in-the-cms)

There are a couple of low level ways to give the CMS users a hint about untranslatable fields. This should also work in the general backend even without the CMS module and in the ModelAdmin of DataObjects.

You can add some custom CSS classes to the FormField elemnts of all untranslatable fields. Add this to mysite/\_config/untranslatablefields.yml:

```
UntranslatableFields:
  add_classes_to_cms:
   - untranslatable
   - 'another-class'
```

You can also set HTML attributes in the same way:

```
UntranslatableFields:
  add_attributes_to_cms:
   - data-untranslatable: yes
   - title: "This field can't be translated separately. Changes to this field are saved across all existing translations."
```

Just for you to know: if you are untranslating fields that has no CMS fields, this feature won't interfere with them: the module only tries to add these classees/attributes to those fields that exist in the CMS/ModelAdmin editor.

Notes
-----

[](#notes)

- Class names and field names are case sensitive
- What else did I have in my mind? I forgot :(

Dreams
------

[](#dreams)

Stuff that *could* be done:

- Checking class inheritance: no need to specify child classes separately. Also implement star prefix (\*Class) in order to target a class exclusively.
- Global untranslatable fields: untranslate these fields in all classes that extend this module

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/611d4d836f6db7ba7357ea174bf48ab8cf86af5ac40be4a7a6101e67267333f9?d=identicon)[taitava](/maintainers/taitava)

---

Top Contributors

[![Taitava](https://avatars.githubusercontent.com/u/13002142?v=4)](https://github.com/Taitava "Taitava (4 commits)")

### Embed Badge

![Health badge](/badges/taitava-silverstripe-untranslatablefields/health.svg)

```
[![Health](https://phpackages.com/badges/taitava-silverstripe-untranslatablefields/health.svg)](https://phpackages.com/packages/taitava-silverstripe-untranslatablefields)
```

###  Alternatives

[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1926.6k1](/packages/smmoosavi-php-gettext)[laradevs/spanish

labels translated to spanish

166.7k](/packages/laradevs-spanish)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
