PHPackages                             hsnfirdaus/subtitle-google-translator - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hsnfirdaus/subtitle-google-translator

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

hsnfirdaus/subtitle-google-translator
=====================================

Php subtitle translator using Google Translate

v2.2(5y ago)2712Apache-2.0PHP

Since Sep 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/hsnfirdaus/subtitle-google-translator)[ Packagist](https://packagist.org/packages/hsnfirdaus/subtitle-google-translator)[ RSS](/packages/hsnfirdaus-subtitle-google-translator/feed)WikiDiscussions master Synced today

READMEChangelog (2)DependenciesVersions (7)Used By (0)

Subtitle Google Translator
==========================

[](#subtitle-google-translator)

A php library to translate subtitle srt format with google translate.

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

[](#installation)

### Using Composer

[](#using-composer)

It's recomended to install this library by [Composer](https://getcomposer.org/) :

```
composer require hsnfirdaus/subtitle-google-translator

```

### Manual Installation

[](#manual-installation)

You can just manually download this repository as zip and extract to your project directory and include the `src/SubtitleTranslator.php` file.

### Calling the class

[](#calling-the-class)

You can call this sdk class like this :

```
require __DIR__ . '/vendor/autoload.php';
$translator = new Hsnfirdaus\SubtitleTranslator($source_lang,$target_lang);
```

### Parameters on Calling

[](#parameters-on-calling)

ParameterTypeDefault ValueDetails`$source_lang``string`autoThe source language code (en,id,da, e.t.c)`$target_lang``string`idThe target language code (en,id,da, e.t.c)### Response

[](#response)

The response of method on this class is raw srt.

### Note

[](#note)

Input subtitle type must be srt and output type will be srt to.

Usage
=====

[](#usage)

- **[From Raw](#from-raw)**
    - [Parameters](#parameters)
- **[From File](#from-file)**
    - [Parameters](#parameters-1)

From Raw
--------

[](#from-raw)

```
$translator = new Hsnfirdaus\SubtitleTranslator($source_lang,$target_lang);
$translated = $translator->fromRaw($raw_subtitle);
echo $translated;
```

### Parameters

[](#parameters)

ParameterTypeDefault ValueDetails`$raw_subtitle``string`nullThe raw text from subtitle.From File
---------

[](#from-file)

```
$translator = new Hsnfirdaus\SubtitleTranslator($source_lang,$target_lang);
$translated = $translator->fromFile($file_path);
echo $translated;
```

### Parameters

[](#parameters-1)

ParameterTypeDefault ValueDetails`$file_path``string`nullThe realpath of subtitle file.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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.

###  Release Activity

Cadence

Every ~18 days

Total

6

Last Release

1967d ago

Major Versions

v1.1 → v2.02020-10-23

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

google-translatesubtitlesubtitle googlesubtitle translator

### Embed Badge

![Health badge](/badges/hsnfirdaus-subtitle-google-translator/health.svg)

```
[![Health](https://phpackages.com/badges/hsnfirdaus-subtitle-google-translator/health.svg)](https://phpackages.com/packages/hsnfirdaus-subtitle-google-translator)
```

###  Alternatives

[captioning/captioning

A collection of tools to manipulate subtitles

2261.3M7](/packages/captioning-captioning)[prgayman/laravel-zatca

Laravel package a helper to Generate the QR code and signed it for ZATCA E-invoicing

2926.9k1](/packages/prgayman-laravel-zatca)[ducks-project/spl-types

Polyfill Module for SplType PHP extension. This extension aims at helping people making PHP a stronger typed language and can be a good alternative to scalar type hinting. It provides different typehandling classes as such as integer, float, bool, enum and string

1032.4k](/packages/ducks-project-spl-types)

PHPackages © 2026

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