PHPackages                             cosninix/sin - 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. cosninix/sin

ActiveLibrary[Localization &amp; i18n](/categories/localization)

cosninix/sin
============

Simple internationalization for Laravel

v2.0.04(2y ago)02.6kMITPHPPHP ^7|^8

Since Aug 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rvwoens/sin)[ Packagist](https://packagist.org/packages/cosninix/sin)[ RSS](/packages/cosninix-sin/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (5)Versions (35)Used By (0)

Sin - Simple Internationalization for Laravel
---------------------------------------------

[](#sin---simple-internationalization-for-laravel)

[![GitHub Release](https://camo.githubusercontent.com/5712ffedcbe87405f51e38b9ec4095971e4638ef103c69ab1d2954bbc6252936/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f7276776f656e732f73696e2e7376673f7374796c653d666c6174)](//packagist.org/packages/cosninix/sin)[![GitHub Release](https://camo.githubusercontent.com/b640914489038a9128f86bbc38eba8030581f6b849dcb89679e305ccc090e078/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f736e696e69782f73696e2e7376673f7374796c653d666c6174)](//packagist.org/packages/cosninix/sin)[![Total Downloads](https://camo.githubusercontent.com/498292240f90adb6589b65ea1167cd507f05f5566291786c646cc1937a4a28d9/68747470733a2f2f706f7365722e707567782e6f72672f636f736e696e69782f73696e2f646f776e6c6f616473)](//packagist.org/packages/cosninix/sin)[![License](https://camo.githubusercontent.com/0eaef7c53da3a48d7e73c605dd2ee4c61fa910acb0332edfd4aa159410d77c88/68747470733a2f2f706f7365722e707567782e6f72672f636f736e696e69782f73696e2f6c6963656e7365)](//packagist.org/packages/cosninix/sin)[![Actions Status](https://github.com/rvwoens/sin/workflows/CI/badge.svg)](https://github.com/rvwoens/sin/actions)

Sin takes a whole new approach to internationalization (i18n) that is useful for simple projects or when the developer can make fast translations on the fly. The way it works is very simple: Just define a string in a special format containg all the languages, as follows:

```
"en::What is your name?|nl::Wat je is naam?|de::Wie heisst du?|fr::Comment t'appelles-tu?"

```

Because Sin uses strings only, it can be used in code, but also in databases, yaml or json files or anywhere where a string is presented to the user.

Sin integrates seemless with Laravel and uses the old and new laravel internationalization styles so it can be seen as an add-on to this mechanism.

Sin is most useful for bi-lingual applications (like dutch/english) where the developer includes immediate translations while coding.

#### Installation

[](#installation)

```
    composer install cosninix/sin

```

The sin package creates the *Sin* facade alias, a serviceprovider and a helper function

#### Basic usage

[](#basic-usage)

```
    echo app('Sin')->lang("nl::via de serviceprovider|en::via the serviceprovider");

    echo Sin::lang("nl::via de Sin facade deze keer|en::through the Sin facade this time");

    // three underscores
    echo ___("nl::via de helper function|en::works with the helper function");

```

and also in blade using the **@slang** directive

```
    @slang('nl::blade constructie|en::blade construct')

```

If the sin syntax is not found, Sin passes the string as is. The syntax is triggered on all strings beginning wih the XX:: format.

```
    Sin::lang('passed without alterations %f'); --> 'passed without alterations %f'

```

Sin runs every result (where syntax is triggered!) through sprintf:

```
    Sin::lang("en::We have %d smartphones in stock|nl::nu %d smartphones op voorraad",20);

```

Of course, Sin is not limited to php code. You can use Sin in yaml or json files as long as you pass it through Sin before presenting it.

```
    list: { options: [ 1, 3 ], text: [ "nl::kies 1|en::choose 1", "nl::Neem er 3|en::Take 3" ] }

```

For instance this could be done with database values in blade:

```
    @slang( $stock->article_name )

```

#### Laravel integration

[](#laravel-integration)

Sin takes the app.locale config as the default language and app.fallback\_locale as fallback. If you change the app language using

```
    App::setLocale('nl');

```

If the current language is not found, the fallback locale is used.

You can prepare for Laravel translations by giving an additional laravel key that can be used with the traditional @lang construct:

```
    Sin::lang('nl::Nederlands|en::English|@@::language_key);

```

If the *language\_key* exists in the laravel translations, this takes priority, otherwise the Sin translations are used. So you can add traditional translations later on.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~33 days

Recently: every ~0 days

Total

34

Last Release

1010d ago

Major Versions

v0.0.20 → v1.0.002020-08-11

v1.0.08 → v2.0.002023-08-08

PHP version history (2 changes)v0.0.01PHP ^7.0.0

v1.0.07PHP ^7|^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/b5d4682983676b85852e58e6c6cc98bf4d5c49c3f83ddb8d3e2939a025bd831f?d=identicon)[rvwoens](/maintainers/rvwoens)

---

Top Contributors

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

---

Tags

internationalizationi18nlibrary

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/cosninix-sin/health.svg)

```
[![Health](https://phpackages.com/badges/cosninix-sin/health.svg)](https://phpackages.com/packages/cosninix-sin)
```

###  Alternatives

[symfony/intl

Provides access to the localization data of the ICU library

2.6k199.8M1.1k](/packages/symfony-intl)[gettext/languages

gettext languages with plural rules

7530.3M11](/packages/gettext-languages)[punic/punic

PHP-Unicode CLDR

1542.9M29](/packages/punic-punic)[aura/intl

The Aura Intl package provides internationalization tools, specifically message translation.

898.3M4](/packages/aura-intl)[inpsyde/multilingual-press

Simply THE multisite-based free open source plugin for your multilingual websites.

2414.0k1](/packages/inpsyde-multilingual-press)

PHPackages © 2026

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