PHPackages                             moderntribe/weglot-companion - 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. moderntribe/weglot-companion

AbandonedArchivedWordpress-plugin[Localization &amp; i18n](/categories/localization)

moderntribe/weglot-companion
============================

Weglot Companion WordPress Plugin

1.3.1(3y ago)02PHPPHP &gt;=7.4

Since May 9Pushed 3y ago11 watchersCompare

[ Source](https://github.com/moderntribe/weglot-companion)[ Packagist](https://packagist.org/packages/moderntribe/weglot-companion)[ Docs](https://github.com/moderntribe/weglot-companion)[ RSS](/packages/moderntribe-weglot-companion/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (20)Versions (14)Used By (0)

Weglot Companion
================

[](#weglot-companion)

Provides additional functionality for the [Weglot Translate Plugin](https://wordpress.org/plugins/weglot/).

---

This plugin makes available the following features:

1. Translation caching using object caching.
2. Better translate filters/interfaces for developer use to translate content manually that Weglot is unable to translate.

Manually translate content that Weglot misses, like HTML returned from an Ajax request.

The Weglot plugin must be installed and activated for this to work, otherwise it will just silently return the original content.

#### Translate an HTML string

[](#translate-an-html-string)

```
$translated = apply_filters( \Tribe\Weglot\Translate\Translate_Subscriber::FILTER, 'Some kind of HTML content' );
```

#### Translate an array of HTML strings

[](#translate-an-array-of-html-strings)

```
$translated = apply_filters( \Tribe\Weglot\Translate\Translate_Subscriber::FILTER, [
    'some content',
    'some more content'
    // etc...
] );
```

---

### Requirements

[](#requirements)

- php7.4+
- docker
- docker-compose v2+
- nvm or fnm
- node 16+
- yarn 1.22+
- npm 8.3+

### Quick Start First Run

[](#quick-start-first-run)

1. Install [SquareOne Docker (so)](https://github.com/moderntribe/square1-global-docker#squareone-docker)
2. Run: `nvm use`
3. Run: `yarn install`
4. Run: `yarn mix`
5. Run: `so bootstrap`
6. Activate your plugin(s) in the WordPress dashboard and start developing!

### Pull Requests / Building

[](#pull-requests--building)

Ensure you run `nvm use` and `yarn prod` and commit the `resources/dist` folder before submitting a PR, so the plugin includes the latest front-end production build.

### Front end

[](#front-end)

Front end building is powered by [Laravel Mix](https://laravel-mix.com/).

#### Installation

[](#installation)

```
nvm use; yarn install
```

#### Usage

[](#usage)

Run once: `nvm use` and then...

Build for development:

```
yarn dev
```

Watch for file changes:

```
yarn watch
```

Poll for file changes:

```
yarn watch-poll
```

Watch with hot module replacement:

```
yarn hot
```

Build for production:

```
yarn prod
```

See more options: `yarn mix --help`

### Installing this plugin

[](#installing-this-plugin)

#### Composer

[](#composer)

If you're using our [SquareOne Framework](https://github.com/moderntribe/square-one) with [Tribe Libs](https://github.com/moderntribe/tribe-libs) v3.4+ you can likely just create a release and composer require the plugin. However, if this results in composer conflicts that can't be resolved, use the private composer method below.

```
composer require moderntribe/weglot-companion
```

#### Private Composer Installer

[](#private-composer-installer)

Every published [release](https://github.com/moderntribe/weglot-companion/releases) automatically creates a `weglot-companion.zip` which is a fully built and vendor scoped WordPress plugin, about a minute after the release is published. To manually install, visit a release and download and extract the zip in your WordPress plugins folder.

However, the best way to include the release zip is by using the fantastic [ffraenz/private-composer-installer](https://github.com/ffraenz/private-composer-installer) plugin.

Add a custom repository to your project's `repository` key in `composer.json`:

```
  "repositories": [
    {
      "type": "package",
      "package": {
        "name": "moderntribe/weglot-companion",
        "version": "1.0.0",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://github.com/moderntribe/weglot-companion/releases/download/{%VERSION}/weglot-companion.zip"
        },
        "require": {
          "ffraenz/private-composer-installer": "^5.0"
        }
      }
    },
 ],
```

> NOTE: Simply update the version above and run `composer update` to upgrade the plugin in the future.

Then, add the plugin definition to the require section:

```
  "require": {
    "moderntribe/weglot-companion": "*",
  }
```

Tell composer where to put your WordPress plugins/themes via the `extra` section.

> NOTE: Adjust the paths based on your project.

```
  "extra": {
    "wordpress-install-dir": "wp",
    "installer-paths": {
      "wp-content/mu-plugins/{$name}": [
        "type:wordpress-muplugin"
      ],
      "wp-content/plugins/{$name}": [
        "type:wordpress-plugin"
      ],
      "wp-content/themes/{$name}": [
        "type:wordpress-theme"
      ]
    }
  },
```

You may have to allow this plugin in your config as well:

```
    "allow-plugins": {
      "composer/installers": true,
      "ffraenz/private-composer-installer": true,
    }
```

Finally, install the plugin:

```
composer update
```

### Tests

[](#tests)

Automated testing is powered by [wp-browser](https://wpbrowser.wptestkit.dev/) and [Codeception](http://codeception.com/).

`so test` is a proxy command for the [codeception cli](https://codeception.com/docs/reference/Commands).

Run all test suites:

```
so project:test
```

Or, run an individual test suite: `unit, integration, functional, webdriver`, e.g.

```
so test run integration
```

Or, run with debugging enabled:

```
so -- test run integration --debug
```

### Credits

[](#credits)

- Based on [Spatie Skeleton](https://github.com/spatie/package-skeleton-php)

### License

[](#license)

GNU General Public License GPLv2 (or later). Please see [License File](LICENSE.md) for more information.

### Modern Tribe

[](#modern-tribe)

[![https://tri.be/contact/](https://camo.githubusercontent.com/1cc6134398300c1d34d415968e0e105345f0a946e07d8605a3945fa3cd1003f0/68747470733a2f2f6d6f6465726e74726962652d636f6d6d6f6e2e73332e75732d776573742d322e616d617a6f6e6177732e636f6d2f6d61726b6574696e672f4d6f6465726e54726962652d42616e6e65722e706e67)](https://camo.githubusercontent.com/1cc6134398300c1d34d415968e0e105345f0a946e07d8605a3945fa3cd1003f0/68747470733a2f2f6d6f6465726e74726962652d636f6d6d6f6e2e73332e75732d776573742d322e616d617a6f6e6177732e636f6d2f6d61726b6574696e672f4d6f6465726e54726962652d42616e6e65722e706e67)

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.8% 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 ~9 days

Recently: every ~26 days

Total

13

Last Release

1402d ago

PHP version history (2 changes)1.0.0PHP ^7.4||^8.0

1.3.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a11f5bee6606989680c8f81b921f8a8e2e75bfd5190cb001812ed615d032a5e?d=identicon)[tribejustin](/maintainers/tribejustin)

---

Top Contributors

[![defunctl](https://avatars.githubusercontent.com/u/1066195?v=4)](https://github.com/defunctl "defunctl (23 commits)")[![whoami-pwd](https://avatars.githubusercontent.com/u/33621842?v=4)](https://github.com/whoami-pwd "whoami-pwd (1 commits)")

---

Tags

modern tribeweglot-companion

### Embed Badge

![Health badge](/badges/moderntribe-weglot-companion/health.svg)

```
[![Health](https://phpackages.com/badges/moderntribe-weglot-companion/health.svg)](https://phpackages.com/packages/moderntribe-weglot-companion)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M19.9k](/packages/laravel-framework)[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[symfony/html-sanitizer

Provides an object-oriented API to sanitize untrusted HTML input for safe insertion into a document's DOM.

27941.7M138](/packages/symfony-html-sanitizer)[amphp/http-server

A non-blocking HTTP application server for PHP based on Amp.

1.3k6.7M108](/packages/amphp-http-server)[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.5k902.0k22](/packages/danog-madelineproto)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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