Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support stable. #16

Open
mekemoke opened this issue Sep 14, 2018 · 4 comments
Open

Support stable. #16

mekemoke opened this issue Sep 14, 2018 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mekemoke
Copy link

mekemoke commented Sep 14, 2018

Imported file only had 30 strings.
Not sure about order of strings.

Plugin: Customize Snapshots (Beta Plugin)
Locale: ja

@mayukojpn mayukojpn changed the title Customize Snapshots(ベータプラグイン)で .po ファイルが30行しか取得できない Imported file only includes 30 strings. Sep 14, 2018
@mayukojpn mayukojpn added bug Something isn't working help wanted Extra attention is needed labels Sep 14, 2018
@mekemoke
Copy link
Author

mekemoke commented Sep 14, 2018

Problem: Translation was put on stable
Recommended Fix: import translation files from stable to dev.

force-update-translations.php 145

function get_source_path( $project, $locale, $format = 'mo', $type = 'dev' ) {
		$locale = GP_Locales::by_field( 'wp_locale', $locale );
		$path = sprintf( 'https://translate.wordpress.org/projects/%1$s/%2$s/%3$s/default/export-translations?filters[status]=current_or_waiting_or_fuzzy',
			$project,
			$type,
			$locale->slug
		);
		$path = ( $format == 'po' ) ? $path : $path . '&format=' . $format;
		$path = esc_url_raw( $path );
		return $path;
	}

ここで $type に dev を渡されていて、変更する手段がないのが原因でした。

@mayukojpn mayukojpn changed the title Imported file only includes 30 strings. Support stable. Sep 14, 2018
@mayukojpn mayukojpn added enhancement New feature or request and removed bug Something isn't working labels Sep 14, 2018
@mayukojpn mayukojpn added this to the Future Release milestone Sep 19, 2018
@pedro-mendonca
Copy link
Collaborator

Some repos only have stable and some only dev.
Would it make sense to have both links? Example:
Update translations dev | stable
The above suggestion was inspired on the plugin GP Import Translations from wordress.org that adds both links on the bottom of the translation tables.

Or will it make sense to try first to get from stable and if error returned, try getting from dev, keeping a single action link as currently?

@ePascalC
Copy link
Contributor

If you put both dev and stable as choices, then you probably need to check for the existence before showing both options.
I would keep only 1 possible option, try to load dev and if nothing found, try to load stable

@pedro-mendonca
Copy link
Collaborator

I agree with @ePascalC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants